Solved

FME datetime question

  • 23 January 2024
  • 5 replies
  • 40 views

Badge +3

Hello - I am retrieving value from "date" field using ArcGIS portal services . It seemed to be in this datetime format ( YYYYMMDDHHMMSS like below screenshot) on UTC time. I would like to change this to local time. Please help on how this can be achieved. Tried using datetime converter, but does not seem to work .

 

image.pngThanks,

Naveen

icon

Best answer by nielsgerrits 23 January 2024, 15:15

View original

5 replies

Userlevel 5
Badge +32

What have you tried in the DateTimeConverter?

Badge +11

pls refer this

 

safe1

Badge +39

The DateTimeConverter is used to change the format, not to change the timezone. Also, you know the original data is UTC, but for the machine to know that it needs +00:00 added. 

 

If you want to go from 20230821160000 UTC to local time, you can use @TimeZoneSet() in the AttributeCreator. See the documentation.

 

I think you need

@TimeZoneSet(@TimeZoneSet(20230821160000,utc),local)

which takes you datetime, set it to utc (adds +00:00) and converts that to your local timezone.

 

Badge +3

The DateTimeConverter is used to change the format, not to change the timezone. Also, you know the original data is UTC, but for the machine to know that it needs +00:00 added. 

 

If you want to go from 20230821160000 UTC to local time, you can use @TimeZoneSet() in the AttributeCreator. See the documentation.

 

I think you need

@TimeZoneSet(@TimeZoneSet(20230821160000,utc),local)

which takes you datetime, set it to utc (adds +00:00) and converts that to your local timezone.

 

@nielsgerrits​ This worked. Thanks so much.

Badge +39

@nielsgerrits​ This worked. Thanks so much.

Cheers :)

Reply