convert from UTC time to a string

638
2
Jump to solution
08-20-2021 03:55 PM
HaowenRui
New Contributor II

Hello,

I am trying to pull UTC time data on my feature layer to a leaflet web map. The data is captured by the QuickCapture mobile application and it shows up fine on Esri Online: Screen Shot 2021-08-20 at 2.28.34 PM.png. However, when I pull it off to leaflet, the date becomes some unconverted UTC time: Screen Shot 2021-08-20 at 2.28.48 PM.png

Is there a formula or an Esri function that can convert that long integer into an understandable date and time?

Thanks in advance!

0 Kudos
1 Solution

Accepted Solutions
Mandy_Li
Esri Contributor

Hi @HaowenRui, you can try converting this timestamp (epoch time) to your targeted date/time. For example, use 'new Date(timestamp)' to convert it to your local time, or search for other JS functions to convert it to a date format of a designated time zone. Thanks!

View solution in original post

2 Replies
Mandy_Li
Esri Contributor

Hi @HaowenRui, you can try converting this timestamp (epoch time) to your targeted date/time. For example, use 'new Date(timestamp)' to convert it to your local time, or search for other JS functions to convert it to a date format of a designated time zone. Thanks!

HaowenRui
New Contributor II

That worked, thanks a lot!

0 Kudos