Solved

date time format milliseconds after epoch conversion?

  • 22 March 2022
  • 1 reply
  • 26 views

Badge

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

icon

Best answer by ctredinnick 22 March 2022, 04:32

View original

1 reply

Userlevel 3
Badge +16

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