Skip to main content
Solved

FME datetime question

  • January 23, 2024
  • 5 replies
  • 123 views

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.

 

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.

5 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • January 23, 2024

What have you tried in the DateTimeConverter?


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

pls refer this

 

safe1


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • 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
  • 12 replies
  • January 24, 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.

 

@nielsgerrits​ This worked. Thanks so much.


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • January 24, 2024

@nielsgerrits​ This worked. Thanks so much.

Cheers :)