Skip to main content
Solved

date time format milliseconds after epoch conversion?

  • March 22, 2022
  • 1 reply
  • 123 views

Forum|alt.badge.img

I have an incoming string attribute e.g. 20220322100000 which I need to convert to milliseconds after epoch for writing to an ESRI Portal Feature Service.

 

I can't seem to work around this output format error below in Desktop 2021.2?

`Failed to evaluate expression '@DateTimeFormat(20220322100000,%s)'. Result is set to null'

image

Best answer by ctredinnick

Use %Es instead of %s

If you follow the link on the warning in the transformer - https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/Date-Time-Functions.htm it says that %s is not supported for converting an unzoned datetime. If your datetime has a timezone, the function to convert to epoch seconds is %s. If your datetime doesn't have a timezone, the function is %Es.

 

View original
Did this help you find an answer to your question?

1 reply

ctredinnick
Supporter
Forum|alt.badge.img+18
  • Supporter
  • Best Answer
  • March 22, 2022

Use %Es instead of %s

If you follow the link on the warning in the transformer - https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/Date-Time-Functions.htm it says that %s is not supported for converting an unzoned datetime. If your datetime has a timezone, the function to convert to epoch seconds is %s. If your datetime doesn't have a timezone, the function is %Es.

 


Reply


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