Select to view content in your preferred language

Date Display

6016
12
Jump to solution
11-03-2015 09:59 AM
MarkCederholm
Frequent Contributor

Apps developed using Web AppBuilder are not showing our dates stored in ArcSDE (Oracle) correctly.  For example, dates stored as midnight November 3 are displaying as November 2.  I'm sure this is a GMT issue.  Is there any way to fix this via an application configuration?  Or does something need to be done at the web map or portal level?

12 Replies
MarkCederholm
Frequent Contributor

OK, as an experiment, I stored a time value as something other than midnight or 7 AM (which is the UTC equivalent of midnight).  The value stored in Oracle is '9/2/2015 3:35:00 PM'.  ArcGIS Server assumes that that value is UTC, and the value returned is 1441208100000.  That's fine.

Back to ArcMap: I add the ArcGIS Server map service as a layer and identify the feature.  Again, the value displays as '9/2/2015 3:35:00 PM'.  It is not converted to local time, which would be 7 hours earlier.  In Runtime, I query the ArcGIS Server map service, and the time populated in the feature object returned is once again the UTC time, not local time [but at least it's internally marked as UTC].  Only JavaScript automatically converts to local time, like it or not.

Once again, if there were a way to configure ArcGIS Desktop to work properly with UTC values, this would not be such a huge issue.  At this point, however, changing our database dates does not seem viable.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mark,

   GeoNet is not a standard support avenue so placing a call to esri tech support with you issue is your next step.

0 Kudos
MarkCederholm
Frequent Contributor

At last!  I found a simple, effective solution that works in Web AppBuilder!  In env.js, I overrode the Date(milliseconds) constructor.  See this thread for more info:

http://stackoverflow.com/questions/13839318/javascript-override-date-prototype-constructor

0 Kudos