Hi Chris, Thanx for the link... I had already found that. My problem is not finding information but more understanding it. I've only been Pythoning for a short while and I don't fully understand what the documentation is getting at sometimes.
Is it saying that I should define a new class inheriting from tzinfo and refine the behaviour of the dst() function? If so, then what do I do with the class? On 30 Mar, 13:08, Chris <cwi...@gmail.com> wrote: > On Mar 30, 1:47 pm, CinnamonDonkey <cinnamondon...@googlemail.com> > wrote: > > > > > Hi All, > > > I had the following bit of code which was working fine until we went > > into Daylight saving this weekend, now the result is an hour out. > > > timeString = "20090330 15:45:23" > > > timeFormat = '%Y-%m-%d %H:%M:%S' > > > modificationTime = datetime.datetime.utcfromtimestamp( time.mktime > > ( time.strptime( timeString, timeFormat ) ) ) > > minutesToAdvance = datetime.timedelta( minutes=5 ) > > > modificationTime = modificationTime + minutesToAdvance > > > datetimeString = str ( modificationTime ).replace( ' ', 'T' ) > > > The expected result should be: > > > datetimeString = "20090330T15:50:23" > > > But instead I get: > > > datetimeString = "20090330T14:50:23" > > > I believe it is going wrong at either the mktime() or utcfromtimestamp > > () stage. > > > What is the correct way to fix this compensating for daylight saving > > automatically? > > > Regards, > > SHaun >8) > > Take a look at the datetime > docshttp://docs.python.org/library/datetime.html#datetime.tzinfo.dst -- http://mail.python.org/mailman/listinfo/python-list