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!
Solved! Go to Solution.
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,
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
If you have multiple Esri accounts I can't stop you
I would be interested in hearing your specific use case for wanting to override the conversion to local time zone. Per the idea this is something that is being considered for a future update - would you want this to be the case for all your maps and apps? Just specific applications? Would you want to be able to stick the time in a specific time zone for display or rather have it display in UTC only?
More generally, what apps do you display or use time in, and from where does the data originate? What is the benefit to your organization to not use local time?
I do have multiple accounts, unfortunately they are linked and I can only be counted once lol
I work for the City of Baton Rouge Information Services Department. We support all the municipal agencies and departments, and I more specifically work with public safety/ law enforcement.
So we use 911 Calls for Service (CFS) and reported crime. The data is updated in our SQL database nightly via a .csv file emailed from the Communications District, who maintain the Computer Aided Dispatch (CAD).... here's where it really gets fun... we have older servers and are stuck at 10.4 until, well, the city gets the money to pay for new servers I suppose. Esri won't even support 10.4 after the next update, and not exactly pouring all their resources in to it now.
Long story short, the hosted services we had published on our server with near real time CFS and officer locations suffered catastrophic failures right around the time of the UC and we've been scrambling to do damage control ever since. We've piece milled everything back together except for one very specific date filter issue. Any filter using "is within the last" or similar expressions cause an error accessing the data. I have several dashboards and various apps that show 2 week overviews or similar metrics.The work around we have for now is overwrite the a published feature layer every morning after the SQL update completes to uptake the new data to our portal. <probably more directly what you were asking> The data has several time fields such as CallDate, FirstArrival, ClosedDate and these are based on when they happened as they happened for the officers and witness/ victim or whoever. No one says, I was mugged at 10:00 PM UTC, they'll say the time of day 4:00 PM/ 5:00 PM depending on daylight savings time.
My problem is that when I publish or overwrite using the proper time configurations that data is correct and displays exactly as it should.
But when I use the script found here it reverts back to UTC.
I've been wracking my brain trying to figure out what seems like it should be a simple. Passing of the time zone parameter during the overwrite or after it is done.
Hi Brandon Jumonville thanks for the description of this. It looks like when publishing or overwriting through the UI the publish parameter dateFieldsTimeReference (documentation here: Publish Item—ArcGIS REST API | ArcGIS for Developers) is used, and in the publish call I'm seeing in the script (fs = sdItem.publish(overwrite=True)) there isn't a publish parameters JSON object referenced. To verify this I would capture web traffic with Fiddler when doing each operation and look at the request parameters for the publish call. Then in the script, you can modify the publish params to mirror what you're seeing in the manual publish to hopefully resolve this issue. Here is the guide for how to implement publish parameters into the ArcGIS API for Python's publish call: arcgis.gis module — arcgis 1.8.2 documentation