Problem
If you work with ArcGIS Online hosted feature services in ArcGIS Pro and your service has date fields, then you may have noticed that date-time values for web feature layers in ArcGIS Pro are always in UTC. This can be seen when you:
- Display them as labels on a map or in an attribute table window
- Make a selection or query using date-time values
- Create or edit features
This leads to two issues:
- Let’s assume you live in Sydney, Australia and you share some local events as a feature service in ArcGIS Online. When you consume the service in ArcGIS Pro, the date-time values for those events appear 11 hours behind in UTC time.
For example, the date value ‘1/16/2018’ would appear as ‘1/15/2018 1:00:00 PM’. - This requires you to do some mental math while you are querying or editing features.
It can be frustrating, as the data can appear incorrect, and it can also potentially lead to incorrect data entry.
Solution
We are pleased to announce that with the ArcGIS Pro 2.7 and ArcGIS Online December releases, these problems are resolved.
Here is what you need to do:
A) Configure your feature service with a preferred time zone.
Just like the date field’s default time zone, this is something you will set at the service level and all layers in that feature service will inherit the settings.
- Go to the service UpdateDefinition operation page (you must be the owner of the feature service).
- https://servicesdev.arcgis.com/…/arcgis/rest/admin/services/<yourServerName>/FeatureServer/updateDefinition?token=<token>&f=pjson
- Remove everything from the text box.
- Copy-paste the JSON below into the text box. This example sets the time zone to Australian Eastern Standard Time.
{ "preferredTimeReference" : { "timeZone" : "AUS Eastern Standard Time", "respectsDaylightSaving" : true } }
- Note: You can find the list of all available Windows time zone IDs from https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms912391(v=winembedded.11.
- Click the Update Layer Definition button.
B) Use ArcGIS Pro 2.7 or a later release.
- Add the feature service to ArcGIS Pro.
- Open the service’s attribute table. Any date-time values displayed in Sydney, Australia time will no longer be 11 hours behind.
A date value of 1/16/2018 will appear as ‘1/16/2018’, and not ‘1/15/2018 1:00:00 PM’. - If you want, you can check the layer’s time zone. There are two places you can see this information:
- In the Layer Properties page’s Time tab, you can view the layer’s Time Zone. With this example, it would be set to ‘(UTC+10:00) Canberra, Melbourne, Sydney)’ instead of UTC.
- In the date field header’s tooltip, you can view the same time zone ID.
- If you want to label your features with date-time values, we recommend you to use the following Arcade expression:
Text($feature.DateOfActivity, "DD/MM/YYYY HH:mm:ss A")
Limitations
- Time zone properties for web feature layers are read-only and cannot be modified.
- If you have some data that are collected from multiple time zones and you want to display/query them in their respective native time zones, you can’t do that right now.
- That is due to the current limitation requiring all date/time attributes must be stored in a single time zone.
A feature service you can try right now…
For your convenience, here is a feature service where the preferred time zone is configured to AUS Eastern Standard Time. You can find the original feature service here which does not have a preferred time zone set. Add both of them to ArcGIS Pro 2.7 or later, and see the difference.
Useful help topics
- Example five: Add the preferred time zone property in Update Definition help
- Working with date fields
Article Discussion: