Skip to main content
Solved

date time format milliseconds after epoch conversion?

  • March 22, 2022
  • 1 reply
  • 171 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.

 

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.

1 reply

ctredinnick
Supporter
Forum|alt.badge.img+19
  • Supporter
  • 225 replies
  • 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.