Current time in particular timezone

May I know how to get the current time in particular timezone?

Hey @scsvel,

The option I found is to use this example and change it to your needs:
The following links might come handy

put now into aTime // store the current time into a variable
put aTime --> 2022-04-12 17:41:58 -0600
put aTime's timeZone --> America/Denver (this is your local timezone)
put aTime's timeZoneOffset --> -6 hours

set aTime's timeZoneOffset to -2 hours // change to a different time zone
put aTime --> 2022-04-12 21:41:58 -0200   (the same point in time, shown in the new time zone)
set aTime.timeZoneAbbreviation to "GMT" // a different way to change the time zone
put aTime --> 2022-04-12 23:41:58 +0000

set aTime's timeZone to "athens"
put aTime.timeZone --> Europe/Athens
put aTime's timeZoneOffset --> 3 hours
put aTime --> 2022-04-13 02:41:58 +0300   (note the date change)

set aTime's timeZone to "denver" // return to the original time zone
put aTime --> 2022-04-12 17:41:58 -0600   (note the actual moment in time has never changed)

hope this helps.
Cheers,
Karsten

1 Like

Thanks @Karsten . I used this logic. I was trying/expecting something simple like below, but couldn’t made it. So used the logic that you mentioned.

put the time in "CT" timeZone
--OR
put the time in timeZone("CT")

Yes, maybe not quite that simple, but close:

get now
put it
set it.timeZone to "CDT"
put it

which for me displays:

2025-05-27 13:42:17 -0600
2025-05-27 14:42:17 -0500
1 Like