ArcGIS Server to return non UTC dates in mapservice REST endpoints

898
4
09-16-2014 04:12 PM
Status: Implemented
GISAdmin9
New Contributor II
Hi Everyone,

I initially logged this with ESRI AU support and even though they said that they had other customers with similar issues, the only resolution was for me to log the issue here as a "requested enhancement".

Here is the issue.

We have data in a sqlserver/ArcSDE database that has a datetime field that does not contain a timezone.
cid:image002.png@01CFC851.D03368D0
 
In ArcGIS Catalogue it displays correctly

 
And you can select within the data ranges ok in Desktop

 
But when a mapservice is published containing the data it is returned via the rest endpoint as milliseconds relative to a timezone – UTC 0. So when you convert the milliseconds to the a date it returns the wrong date and time as it is adding the timezone of the local data ie +10hrs
cid:image006.png@01CFC853.58672830
 
cid:image007.png@01CFC853.BB316110
Which is the incorrect date in the above example.

There should be a way to publish a mapservice so that when the date/time field is returned, the timezone offset is not added to the raw database value.  We need the data as per what is stored in the database.  The data is stored in the database as local time so it essentially has the offset already included and then the mapservice is adding an additional offset.


There should be a mapserver option for dates to be publised in local time or UTC.

Steve 

Tags (1)
4 Comments
DavidFriedrich
We have the same problem. We have datetime columns in our SQL Server database that do not use UTC. When using these in an ArcGIS Server map service, they are interpreted as UTC, and are off by 8 hours.
AaronCohen
I have the exact same issue.
Time is relative to wherever you are at and I am in the US Central time zone!!
Not UTC!
JohnRitsko

We are dealing with the same issue here as well which is beyond annoying to say the least.  I'm hoping ESRI addresses this as well.  Just wanted to add my frustration along with the others.

TanuHoque
Status changed to: Implemented

Ran into this old idea.

Since there are some recent enhancements made in that area, I thought I should put that info here for future readers, and close it.

  1. as you know as per REST API specs (until we made some amendments in recent releases), date/time values are passed around in UTC.
  2. to make sure map/feature services return correct date/time values in a query response by applying the correct time zone conversion, you must set the Date Fields Time Zone in service properties.
    • you can do that in the Server Manager site or in sharing/publishing pane from ArcGIS Pro or ArcMap.
  3. that's said there are some cases where you can't apply a single time zone when you have date/time values from multiple time zone. Also, it is rare but it does happen -- due to lack of historic time zone support in Windows Time libraries, you don't get the correct results.
    • that is when you can set the service time zone to "Unknown"
    • please read this blog article for more info: https://bit.ly/3nm3pLi