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-uploaded-to-arcgis-online
Perhaps a way around is to create a new field and using Arcade to translate the ArcGIS online date and time to the local time.
Hi Yash,
This is expected behavior - ArcGIS Online Web Applications assume that time fields are in UTC and look at the time zone of the browser/machine, then make the conversion to local time.
Hamed's suggestion is a good one - in the pop-up or a field calculation you can use the ToUTC or DateAdd functions to convert the values back to UTC: Date Functions | ArcGIS for Developers
Hope this helps,
-Peter
Thanks! It worked via Arcade expression.
Thanks! I've used Arcade expression for this conversion. But it would've been much easier if it just displays times same as geodatabase.
Hi Yash, glad it worked (I saw your response above and marked Hamed's answer correct). This functionality is currently under consideration. If you have a few minutes I would recommend upvoting this idea and providing your use case: https://community.esri.com/ideas/6934
I have this exact same problem. And I guess I'm struggling to understand how I am supposed to use DateAdd or ToUTC functions to convert values back to UTC. My date/time values in my attribute data are already in UTC/Zulu time. I need the Time Aware app in AGOL to read that data correctly. Peter Klingman, how would I implement your solution with data in MM/DD/YYYY hh:mm:ss format, in a Date field? Furthermore, my data displays accurately, and plays through as desired in a Web Map in AGOL, but doesn't work at all in a Time Aware app. Many thanks in advance.
Hi Mark Johnson,
Thanks for the post - can you share a copy of your layer and the Time Aware app with the ArcGIS Online username PeterK_ess so I can take a closer look? Or if they're public share the links here?
It sounds like something is going on with the configuration of the Time Aware app as the time animation is accurate in the web map. To me this indicates that the date fields do not require any conversion. However looking at the app/layer I think we can figure it out.
Thanks,
Can I vote for it more than once? Haha
Unfortunately, I can't share it. It's all on a closed network with no links to the internet. Sorry.
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
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/idi-p/933972
I hope this helps,
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'.
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.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.