Changing timezones on agent created NotesDateTime

Hello all. I have a domino web calendar that I’m having trouble with. I’m trying to get this calendar to email invites to people but the invites always show up in the timezone of the server. To get down to brass tacks I’m creating the NotesDateTime object with hard-coded values:Set startDateTime = New NotesDateTime(“02/14/2005 08:00:00 AM MST”)

This line of code however:

Print "
startDateTime.LocalTime: " + startDateTime.LocalTime

Will print:

startDateTime.LocalTime: 02/14/2005 10:00:00 AM EST

The agent running this is on an AS/400 server, Eastern Standard timezone. I’ve done some searching here and haven’t found much, which leads me to believe I’m missing something obvious. What I have found though is what I’ve tried above, but that’s not working.

Anyone know what I’m doing wrong?

TIA,

Paul

Subject: Notes client or browser client?

Subject: RE: Notes client or browser client?

Sorry, web browser. All I’ve got when the agent runs (kicked off with @CommandToolsRunMacro from the web) is the date and time. I set a field with the GMT offset so I know where they are coming from.

Subject: Try startDateTime.ConvertToZone(GMToffset, False) …

before the print statement. DST might be True, depending on your latitude.

Subject: RE: Try startDateTime.ConvertToZone(GMToffset, False) …

I see that I was missing something. I was assuming that DateTime.LocalTime would be the time local to the timezone I had set the DateTime object too. LocalTime is the actually the time adjusted to the machine where the script is running. (If the object is MST and the machine is EST LocalTime would be -2 hours.) I needed to use .ZoneTime to get the time of the object in the time zone that the object is set to.

Oh well, now I know lots more ways of creating date time objects than I did before. I even found a method (Merge) on the NoteDateTime object that I don’t see in help. DateTime.Merge(TimeObject, CanonicalTimeZoneAsString). That time zone string looks like “Z=7$DO=0$ZN=US Mountain”

Thanks for your help Bill.