I have a LotusScript code running from a UK server that’s behaving oddly with DateTime. UK is not in DST, but the US is. At the moment, London and NY are 4 hours apart. However, the code returns a 5 hour difference (which would be correct when the US is no longer in DST next week):
timestr$ = “30/10/2007 09:17:55 AM EDT”
Set newDate = New NotesDateTime(timestr$)
But newDate’s properties contain:
LOCALTIME = “30/10/2007 14:17:55 GMT”
GMTTIME = “30/10/2007 14:17:55 GMT”
LSLOCALTIME = 30/10/2007 14:17:55
LSGMTTIME = 30/10/2007 14:17:55
TIMEZONE = 5
ISDST = False
ZONETIME = “30/10/2007 09:17:55 EST”
Notice ZONETIME actually changes the original EDT to EST. The correct UK time should be “30/10/2007 13:17:55 GMT”. The UK server is running Windows 2003 Server and is fully OS patched. Both Windows time zone settings and scheduling appointments on this server properly returns a 4 hour difference between the 2 cities. Any clue what I’m doing wrong?
Did you perform your DST update earlier this year? If not, then the US time will already have been adjusted according to the old DST rules and perhaps this is why you are seeing the 5 hour difference before you expect to see it.
A DST update was applied. When I make an appointment between London and NY using this server, the time difference is 4 hours, not 5. I can also change the Time Zone in Windows between the 2 cities and the time changes by 4 hours.
Yes, DST updates for the OS were applied to all servers. Though in this case, it doesn’t seem like the US server plays a role. The script is run on the UK server and the date that’s fed in is a string.
I’m wondering if anyone else gets the same results when running those two lines of LotusScript from an area that recently exited DST.
For the server, there is really just the OS and JTZU patch. That has been done (though I don’t believe that the Java update would affect the LotusScript part) several months ago. So I’m still scratching my head on this one…
BTW, I appreciate the suggestions you’ve been giving. Thanks!
As a follow-up to this, now that the US has also exited DST, I’ve checked this again on another UK-based server. I create another NotesDateTime based on a fixed string. Notice how the LocalTime settings are telling me the time is 17:41:23 GDT, when the actual time there is 16:41:23 GMT.
06/11/2007 16:49:48 AMgr: Start executing agent ‘printtime’ in ‘printtime.nsf’
06/11/2007 16:49:48 Agent printing: Passed In: 11/06/2007 11:41:23 EST
06/11/2007 16:49:49 AMgr: Agent ‘printtime’ in ‘printtime.nsf’ completed execution
Is this an issue with the how LotusScript is understanding the current time zone?
In a different note, using a db.Search with a NotesDateTime cutoff date across countries that use different time formats (MM/DD/YYYY vs. DD/MM/YYYY) is driving me insane. It believes November 6 (11/6/2007) is June 11 (6/11/2007), making the cut-off date parameter incorrect. :-/ If anyone has insight on this as well, let me know. Back to testing…