__author__ = "Ted Leung <twl@sauria.com>"
__version__ = "$Id:"
__copyright__ = "Copyright (c) 2003 Ted Leung"
__license__ = "Python"

import xml.utils.iso8601
import time

def cb_prepare(args):
    request = args["request"]
    form = request.getHttp()['form']
    config = request.getConfiguration()
    data = request.getData()

    entry_list = data['entry_list']
        
    for i in range(len(entry_list)):
        entry = entry_list[i]
        entry['w3cdate'] = xml.utils.iso8601.ctime(time.mktime(entry['timetuple']))

__author__ = "Ted Leung <twl@sauria.com>"
__version__ = "$Id:"
__copyright__ = "Copyright (c) 2003 Ted Leung"
__license__ = "Python"

import xml.utils.iso8601
import time

def cb_prepare(args):
    request = args["request"]
    form = request.getHttp()['form']
    config = request.getConfiguration()
    data = request.getData()

    entry_list = data['entry_list']
        
    for i in range(len(entry_list)):
        entry = entry_list[i]
        t = entry['timetuple']
        # adjust for daylight savings time
        t = t[0],t[1],t[2],t[3]+time.localtime()[-1],t[4],t[5],t[6],t[7],t[8]
        entry['w3cdate'] = xml.utils.iso8601.ctime(time.mktime(t))

Fix daylight savings time bug
Fix daylight savings time bug


  __author__ = "Ted Leung <twl@sauria.com>"
  __version__ = "$Id:"
  __copyright__ = "Copyright (c) 2003 Ted Leung"
  __license__ = "Python"
  
  import xml.utils.iso8601
  import time
  
  def cb_prepare(args):
      request = args["request"]
      form = request.getHttp()['form']
      config = request.getConfiguration()
      data = request.getData()
  
      entry_list = data['entry_list']
          
      for i in range(len(entry_list)):
          entry = entry_list[i]
+         t = entry['timetuple']
+         # adjust for daylight savings time
+         t = t[0],t[1],t[2],t[3]+time.localtime()[-1],t[4],t[5],t[6],t[7],t[8]
-         entry['w3cdate'] = xml.utils.iso8601.ctime(time.mktime(entry['timetuple']))
+         entry['w3cdate'] = xml.utils.iso8601.ctime(time.mktime(t))
  
Fix daylight savings time bug
## Code Before:
__author__ = "Ted Leung <twl@sauria.com>"
__version__ = "$Id:"
__copyright__ = "Copyright (c) 2003 Ted Leung"
__license__ = "Python"

import xml.utils.iso8601
import time

def cb_prepare(args):
    request = args["request"]
    form = request.getHttp()['form']
    config = request.getConfiguration()
    data = request.getData()

    entry_list = data['entry_list']
        
    for i in range(len(entry_list)):
        entry = entry_list[i]
        entry['w3cdate'] = xml.utils.iso8601.ctime(time.mktime(entry['timetuple']))

## Instruction:
Fix daylight savings time bug
## Code After:
__author__ = "Ted Leung <twl@sauria.com>"
__version__ = "$Id:"
__copyright__ = "Copyright (c) 2003 Ted Leung"
__license__ = "Python"

import xml.utils.iso8601
import time

def cb_prepare(args):
    request = args["request"]
    form = request.getHttp()['form']
    config = request.getConfiguration()
    data = request.getData()

    entry_list = data['entry_list']
        
    for i in range(len(entry_list)):
        entry = entry_list[i]
        t = entry['timetuple']
        # adjust for daylight savings time
        t = t[0],t[1],t[2],t[3]+time.localtime()[-1],t[4],t[5],t[6],t[7],t[8]
        entry['w3cdate'] = xml.utils.iso8601.ctime(time.mktime(t))
