ArcGIS online UTC Time Zone converting to local timezone

14398
34
Jump to solution
11-21-2019 06:44 PM
YashKaja
New Contributor II

We have few DATETIME columns stored in UTC timezone in database. When we view them in ArcGIS online, the timestamps are converted to local timezone, thereby causing the confusion with dates.

"The date and time in a pop-up do not match the date and time in the underlying data."

Followed below articles suggested by support. But no luck. Any thoughts on this issue please? Thanks in advance!

How To: Set the UTC time field to follow a specific time zone 

https://community.esri.com/thread/205882-date-changed-to-strange-values-in-feature-class-when-upload... 

0 Kudos
34 Replies
KinleyWinchester
New Contributor III

Hi Peter,

Another year, even after a new Dashboard, and there are still issues with the date/time.  You mentioned here that AGOL assumes the time is in UTC.  Can you explain why that is necessary?  We have a survey table in a geodatabase and when it is published the time zone is set to central time.  The values in the Date field are correct.  Because AGOL assumes our dates are UTC, here is the query string 'where: Date BETWEEN '2021-04-23 05:00:00' AND '2021-04-24 04:59:59''  All entries before 5a are pushed to the wrong day.  So here is my question:  why can't there be a toggle in the settings to remove this assumption and instead set the selected date query as 'where: Date BETWEEN '2021-04-23 00:00:00' AND '2021-04-23 11:59:59''?  I know the date is correct, the end user knows the date is correct, so why modify it.

Thanks

Kinley

0 Kudos
by Anonymous User
Not applicable

Hi @KinleyWinchester - if you publish the data through ArcGIS Pro and select the time zone when publishing,  the Online database will store the date in UTC but offset it 5 hours forward so that when it is viewed in the UI, it will show up as the correct time in Central time (the conversion on the fly is done based on the time zone of the browser). It sounds like the time is stored in your database in Central time but a time zone isn't specified when publishing. However Dashboards, when creating the time query string, does look at the time zone. 

If you do set your time zone when publishing, I think the issue will be resolved. Alternatively you can calculate a field with the offset either pre or post publish and use that for the Dashboards query. 

The reason for storing date/time in UTC is that feature layers are viewed all over the world and it's important to be able to view a single date field in multiple time zones. That said, there are a lot of good use cases for not doing this, and adding an option to not use UTC in some capacity is under consideration: https://community.esri.com/t5/arcgis-online-ideas/option-to-not-use-utc-time-offset-in-arcgis-online...

I hope this helps,

-Peter 

0 Kudos
KinleyWinchester
New Contributor III

Thanks for the reply @Anonymous User... we are setting the timezone but publishing through ArcServer, so that may be a little different.  However, the dashboard seemed to be handling it (meaning we weren't getting complaints) until the new dashboard a couple of weeks ago.  Not sure what triggered the issue.  It really isn't a 'fix' to require users to add more data fields so the application works.  Also I chuckled a bit after clicking the idea for an option not to use UTC and seeing it was first posted in 2013.  It should be further down the pipeline than 'under consideration'.  To me it's like distance measurement.  AGO doesn't assume all lengths to be in meters and run a conversion on US feet just to display/query them.  UTC is fine, but if I am querying a time field, have an option to use the exact data that is there.  '04/21/2021 00:00:00' is the same value anywhere in the world.  I should be able to query and not see it show up on '04/20/2021'.

by Anonymous User
Not applicable

Hi @KinleyWinchester thanks for the response on this. I think we should get this to Esri Support to investigate the issue further. Since the issue started occurring after the update to the new Dashboards, it sounds like this might be a bug with either the new Dashboards or the updated JavaScript API that it's built on. If you can email me your customer number I can get a case started for you. 

0 Kudos
FermínVargas
New Contributor II

Hola, esto funciona solamente la primera vez que se publica una capa en arcgis online, posteriormente cuando la capa se actualiza con nuevos datos, se desconfigura la hora UTC predefinida, por lo tanto, creo que se debería agregar una opción de configurar la zona horaria directamente en los web map, esto para no tener problemas con las capas que se actualizan costantemente.

0 Kudos