How can I get the current date in a specific timezone in Workato? For an account that is configured as PST, when I run the following command
today.in_time_zone("Europe/Madrid")
it still returns the date in PST, not “Europe/Madrid”. Is this an error?
How can I get it to return the date in PST?
Try
now.in_time_zone("Europe/Madrid").There are some weird interactions with
today. From my observations, both take a default PST time but if you dotoday, it’s a date value where whereas if you usenow, it’s the actual timestamp.e.g.
todayin PST is 31 Jan 2020."31 Jan 2020".in_time_zone("Europe/Madrid")is still 31 Jan 2020.nowin PST is 23:43 31 Jan 2020."23:43 31 Jan 2020".in_time_zone("Europe/Madrid")will convert it to the proper GMT offset.