Skip to main content

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!!!

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

 


Great solution @MattAtSafe


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

 

 


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.


Reply