Skip to main content

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

What have you tried in the DateTimeConverter?


pls refer this

 

safe1


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.


@nielsgerrits​ This worked. Thanks so much.

Cheers :)


Reply