Search code examples
lotusscript

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)

Solution

  • 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.