Select to view content in your preferred language

Enable local time formatting of UTC date/time data

8418
23
01-05-2022 02:57 PM
Status: Open
Labels (1)
AJR
by
Frequent Contributor

It would be nice if ArcGIS Pro had a feature that allowed for the display of data stored in UTC time to be displayed in local time.  For fields (i.e. editor tracking) that are stored as UTC, having to manually do the timezone, conversion is a pain.  A way to tell ArcGIS Pro to display the UTC date/time as local time (from the machine that AGP is running on) should be relatively easy to implement but would be extremely helpful.

23 Comments
TanuHoque

@mthompson 

That recommendation is mostly in the context of editor tracking and when data shared and distributed across multiple time zones.

For the case, when data are all in the same time zone, you can use local/database time zone for the editor tracking workflow as noted in the help:

Database time is based on the local time zone in which your database resides and should only be used when your data is confined to the same time zone.

 

Aside for the editor tracking workflow, for general usage of date/time values, we don't recommend any particular time zone over other. Whatever works best for your workflow. As long as you work within ArcGIS Pro with your local datasets (with all feature/records/data from the same time zone), you don't need to worry about the time zone.

The moment you share your data as a service, we strongly recommend you to specify time zone to your layers before publishing/sharing to enterprise or ArcGIS Online. 

That being said, in recent releases, we have introduced 3 new field/data types to store date & time. If you pick esriFieldTypeTimestampOffset, then you don't need to worry about time zone; that is because time-zone-offset are stored with data themselves. This allows you storing data from multiple time zones in a single layer/table.

They other two types (esriFieldTypeDateOnly and esriFieldTypeTimeOnly) are NOT time zone aware. Values from these two field types are passed around as-is even when they are shared as services and consumed in web clients.

I hope you find this helpful.

mthompson

Can you publish feature services when editor tracking is in Database Time? I believe it used to throw an error and wouldn't let you.

Apologize if I'm being dense, I just want to make sure I'm doing this correctly... if all of our editor tracking fields are in UTC, but we also have various other Date/Time fields in the data (which don't specify time zone when you create them but  all data was entered on devices in Massachusetts), should we set the time zone when we publish to be UTC or EST? There is also now a preferred time zone setting in services so I assume that should that be EST.

If I set the service time zone to UTC and the preferred time zone to EST will the regular date/time fields and the editor tracking both display the correct time in EST in the services?

TanuHoque

@mthompson there is nothing to apologize for 🙂 'Time in computer' is a confusing topic by itself.

Can you publish feature services when editor tracking is in Database Time? I believe it used to throw an error and wouldn't let you.

I just gave it a try and I don't see any analyzer error as long as you set the time zone on the Sharing pane during publishing time.

 

for the scenario you mentioned above, if you already have your feature class populated with data, then you should keep your editor tracking fields' time zone in UTC. If it is a brand new and empty feature class, you can choose either UTC or local/database time zone - depending on what works best for you. 

For you other date/time fields, I'd suggest setting your layer's time zone (if you are in Pro 3.6 and Server 12.0) or service time zone (pre-3.6  or pre-Server 12.0) to EST. You should set the preferred time zone to EST as well.

As you might have noticed in the newer releases client apps such as ArcGIS Pro or Map Viewer allows you to switch map's time zone to any time zone. I believe Map Viewer displays date/time values in the machine local time zone. Whereas Pro displays them in preferred time zone when set, otherwise in UTC; but starting at 3.6 you can change the map's time zone to any time zone even when preferred time zone is not set to the service.

 

If I set the service time zone to UTC and the preferred time zone to EST will the regular date/time fields and the editor tracking both display the correct time in EST in the services?

that is correct, on the client side date/time values are always displayed in one time zone. If your map is in EST (in pre-3.6, ma, all data from any date/time fields (including editor tracking) will be displayed in EST.

 

Also I'd like to share this recording from an Esri event about 4 years ago. Obviously a lot of things changed/improved since then, but the basic concept remains the same for how date/time values from esriFieldTypeDate travels/stored etc.

https://www.youtube.com/watch?v=esb8X-1TtPk