0

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?

TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

0

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 do today, it’s a date value where whereas if you use now, it’s the actual timestamp.

e.g.

  • today in PST is 31 Jan 2020. "31 Jan 2020".in_time_zone("Europe/Madrid") is still 31 Jan 2020.
  • now in 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.
General Grievance
  • 4,555
  • 31
  • 31
  • 45
  • I have improved your post for you this time. Please take the time to use proper grammar, and be careful when copying things from word processors. Smart quotes are not equivalent to `"` when coding. – General Grievance Apr 20 '23 at 14:04