Skip to main content
Question

FME2017.1 DateTime Conversion

  • November 2, 2017
  • 4 replies
  • 64 views

Hello, any datetime expert out there? I have a dataset in yyyymmddhhmmss format in utc time. Now I am trying to convert it to local time with the consideration of daylight saving. I know the newest version of FME has features that support advanced datetime conversion, but still really confused on this especially with daylight time saving. Before, I have a user parameter to ask the user to manually choose the UTC offset. Now I am trying to upgrade my workspace so that I can get rid of this and have the FME detect my UTC offset automatically. Any ideas? Really appreciate it!!!

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • November 3, 2017

Hi @taliat1105

Please find a workspace attached demonstrating this. You can find the documentation on the Date/Time functions here

 

What we need to do is first tell FME that the date is in the UTC time zone. we can do this by using the command:

@TimeZoneSet(@Value(<unzoned_time_attribute>),utc)

Now that FME knows that it is UTC time we can use a similar call on the new attribute value to convert it to your local time zone

@TimeZoneSet(@Value(<utc_zoned_attribute>),local,convert)

0684Q00000ArL2aQAF.png

 


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • November 3, 2017

Great solution @MattAtSafe


bruceharold
Supporter
Forum|alt.badge.img+19
  • Supporter
  • 349 replies
  • November 3, 2017

Great solution @MattAtSafe

Are we sure about this? I can't find documentation about daylight saving being respected, after all that is magic in IT terms, the offset is set by politicians at will. I have always resorted to Python to handle the hour each way, see the attached for setting UTC for the contents of a ZIP file which Matt should be familiar with, us both being from the more fortunate hemisphere :-).

 

 

 

unzipldsdownload.py

 

 


  • Author
  • 2 replies
  • November 3, 2017

Thank you guys for the great idea. I actually managed to convert my data to local time. This feature is great, it cleans up my workspace a lot.