Any way to get ArcGIS Online to stop using UTC and use your organizations local time?
We have several maps in AGOL that use a filter on a date/time field, displaying incidents for a specific day. However, records for a given day (July 20 for example) actually show up as July 19 in AGOL, with no records returned, even though there were in fact incidents on the 20th.
We are not able to modify the date properties in ArcMap or database side of things as far as time zone changes. It is and has to remain in our local time.
I understand why AGO does this, but it drives me crazy and would love it if someone had a workaround they could share. Hopefully it's easy/obvious and I have just missed it.
Thanks -
Allen
Solved! Go to Solution.
Most of the solutions provided are not honored by AGOL. I quite specifically and deliberately specified all of the timezone parameters accross all of my services. Set the timezone in ArcPro prior to publishing and neumerous other settings and even JSON edits directly to the hosted feature service and at the end of the day. the map reader should honor the date and timezone specifed on the clients device. which it doesn't.
I was also having this issue. When publishing to on-premise Enterprise everything was ok but to AGOL the time was using UTC (as documented).
Instead of adding new fields and re-calculating dates to be UTC, you can use your local timezone fields. When publishing to AGOL, in the Configure Parameters window, set you timezone there. The rest will be handled correctly with your local datetime fields.
Have a look at this:
Work with date fields—ArcGIS Online Help | Documentation
and this:
Mastering the Space Time Continuum: Considerations for Publishing Date Fields to the Web (Rule #4).
Please note that if you overwrite your hosted feature layer you must set this everytime.
As previously mentioned I did this. In fact everything is perfectly fine in ArcPro the Problem lies with the construct of AGOL and the defualts setup in there. If you dig into the JSON of the published service you won't find the format code unless you specify it (which I did) Every date feild you publish into AGOL gets the defualts display formating regardless of what you set at the time of publishing which is:
"format": { "dateFormat": "shortDateShortTime", "timezone": "utc" }
or shortDate.
What it should be by defualt for all popups, attribute tables, query windows and displays is:
"format": { "dateFormat": "shortDateLEShortTime", "timezone": "utc" }
Which is in contravention to the help documentation which states: if this change was made in core AGOL coding most of the people in this thread wouldn't be having these issues.
How dates are displayed
The client you use to view the data determines how date and time values are displayed. When a date field is displayed in ArcGIS Online, the date is converted from UTC to your local time. This is done by querying your computer and asking it for its time zone setting. For example, suppose your computer is set to pacific standard time (PST). PST is eight hours behind UTC—when UTC is 9:00 a.m, it is 1:00 a.m. PST (or 2:00 a.m. if daylight saving time is in effect).
I would also ask where the reference is for the "timezone" parameter in the JSON as it doesn't appear to conform to the standards setout in the world time API
http://worldtimeapi.org/timezones in the examples in the help documentation
HI Kelly,
I am helping to develop data for a dashboard for a global org that needs to track vessels that will potentially cross timezones. All of our times are in UTC for the tracking points. When we upload the Portal and view the data in a web map, the time field is being displayed in my local machine timezone. Is there anyway to disable this so that all times are visible to the user are in UTC? This will make it much easier to develop the filters and such and enforce consistency in the app across the globe. This will also ensure that everyone sees the same time for tracking points and that points don't get put into a different date for summary.
Thanks!
Kelly I have the same problem as Richard. I actually need to NOT have the client view localize the UTC time, for the same reason. All of the facilities have zulu time clocks and everything we capture when they enter data is in UTC. But the map popups are converting to local time and I need it to not do that.
What I found as a type of workaround, is to set the clock on the machine itself to be in UTC. Then the data works as expected in the app in the browser. It would be nice to be able to specify this in the api, but it looks like it defaults to the system time settings to display the data in whatever timezone the machine is in.
Only way I've found around the problem of AGOL not accepting anything but UTC from your non-hosted services is to:
- go to the pop up configuration for the layer in your web map
- Add Attribute expression
- for the expression, pick the function ToLocal in the functions tab, and in the brackets put your time field from the globals tab. eg my time field is Last_Position, so the expression is ToLocal($feature["Last_Position"])
- Edit the name of the expression if you like to something other than Custom
- once you click OK, you'll have access to this new attribute in the fields available to you. configure your pop-up to show this field and you'll get your time converted to your local timezone.
Although this works, I'd like to say that it's been a real pain (you know where) to do this for every time field in every layer (we have an AVL map service. say no more...) so please come up with a solution where AGOL accepts the Data Field Setting in the map service. Pleeeeease!!!
We use ArcGIS Server with the ArcGIS Online Map Viewer.
Date / time fields which aren't the specified time field (in the map document) are adjusted by the AGOL Map Viewer by adding 4 or 5 hours to the time (depending on DST or not). There is no way of specifying the time zone so of course the time is wrong after the 4 or 5 hours is added to the time.
The date / time functionality in the ArcGIS Online Map Viewer really needs some work.
When I am publishing from ArcGIS Desktop, I don't have the option to choose a time-zone.
When I add a custom attribute expression as outline above, it does not allow me to format how it displays, so instead of "1/19/2019" - which is easy for the public to quickly read - it says, "Fri Jan 18 2019 17:00:00 GMT-0700 (Mountain Standard Time)" which is way too long and not quickly interpreted which defeats the purpose of easy to view online apps.
Hi Kara,
you can choose the timezone in your mxd. if you choose your layer and go to the time tab. you might be able to change the date format there too.