Solved

FME datetime question

  • 23 January 2024
  • 5 replies
  • 17 views

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 3
Badge +24

What have you tried in the DateTimeConverter?

Badge +3

pls refer this

 

safe1

Userlevel 4
Badge +28

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.

 

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.

Userlevel 4
Badge +28

@nielsgerrits​ This worked. Thanks so much.

Cheers :)

Reply