Skip to main content
Question

DateTimes on FME Cloud

  • December 18, 2020
  • 2 replies
  • 40 views

dbaldacchino1
Supporter
Forum|alt.badge.img+11

I was having some problems with DateTimes on FME Cloud (East Coast cluster) and managed to come up with a solution, but decided to do some reading and checking. I can confirm that my instance is set to Central time, as is my admin account.

 

For some reason, DateTimeNow() returns time in UTC with no offset shown. So my main question: is this by design? It's not the same behavior as in FME Server, so I have to make specific adjustments to workspaces - bummer. I did a quick search and came across a very good and detailed article about the subject by @mark2atsafe​ . Towards the bottom, it states:

  • Timezones and FME Server: I’ve always had problems with timestamps when I’m in one timezone (Central -6:00) but FME is running on a cloud-based server in a another timezone (say Pacific -8:00). Now I don’t have to worry. The DateTimeNow() function lets me specify standard UTC time, so it doesn’t matter where my server is based. I can also ask for local time both with or without timezone.

 

Well, it seems the function just returns UTC, regardless of whether you leave the default () or add "local" (DateTimeFormat was applied to the result):

DTnowTo address this, you have to either do a timezone adjustment by first adding a timezone to the UTC time with a zero offset, and then adding the actual timezone (-5 hours to display the actual time at the data center), or just doing a DateTimeAdd directly. Here are the formulas I used:

  • Timezone adjustment A: @DateTimeFormat(@int(@TimeZoneRemove(@TimeZoneSet(@TimeZoneSet(@DateTimeNow(), -00:00), -05:00))),%I:%M:%S %p (%A - %d %b %Y))<br>
  • Timezone adjustment B: @DateTimeFormat(@int(@DateTimeAdd(@DateTimeNow(),-PT5H)),%I:%M:%S %p (%A - %d %b %Y))

 

And the results:DTadjustThe @int function was used to remove the fractional seconds, which were not important for my use case. Both methods yield the same results, with the B formula being slightly shorter and easier to decipher. So, is it by design that FME Cloud is always returning UTC and is the above always required? Thanks!

2 replies

jovitaatsafe
Safer
Forum|alt.badge.img+11

Hi @dbaldacchino1​,

Thanks for your question! FME Cloud instances are all configured to be in the UTC time zone, and we don't currently support configuring time zones or locales.

 

If this is something that you would like to see added support for, please post a new Idea and share your use case there. With more upvotes showing user interest in this, it'll help inform our development team of the need.


dbaldacchino1
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • December 28, 2020

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings