Gerard Cruz
Gerard Cruz

Reputation: 649

How to display current date/time with timezone in LotusScript?

Same output as Now() but with timezone.

Have tried the following but returned wrong results.

Dim datetim As New NotesDateTime( Now() )
Messagebox datetim.TimeZone
Messagebox datetim.GMTTime

Basically the output I want to see is like this

07/11/2013 01:06:29 PM (Correct GMT, in which case +8:00 in my system)

Upvotes: 1

Views: 4368

Answers (2)

charles ross
charles ross

Reputation: 572

I think the call of convertToZone is required before this will work, even if you are staying in the current zone.

Call dateTime.ConvertToZone(dateTime.TimeZone, True)
Print (dateTime.ZoneTime )

That's my experience.

Upvotes: 0

Knut Herrmann
Knut Herrmann

Reputation: 30960

With property ZoneTime

Messagebox datetim.ZoneTime

you get date, time and zone like 07/11/2013 01:06:29 PM CEDT.

In case you need to adjust to a certain time zone then use convertToZone before. Behind the link is a good example too.

Upvotes: 4

Related Questions