Skip to main content
Solved

FME datetime question


naveen
Contributor
Forum|alt.badge.img+7

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

Best answer by nielsgerrits

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.

 

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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.

5 replies

redgeographics
Celebrity
Forum|alt.badge.img+58

What have you tried in the DateTimeConverter?


f.kemminje
Contributor
Forum|alt.badge.img+11
  • Contributor
  • January 23, 2024

pls refer this

 

safe1


nielsgerrits
VIP
Forum|alt.badge.img+59
  • Best Answer
  • January 23, 2024

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.

 


naveen
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • January 24, 2024
nielsgerrits wrote:

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.


nielsgerrits
VIP
Forum|alt.badge.img+59
naveen wrote:

@nielsgerrits​ This worked. Thanks so much.

Cheers :)


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