How to Fix Web Map After Republishing Map Service with Local Timezone Configured

1385
4
Jump to solution
06-21-2021 05:52 PM
NathanHeickLACSD
Occasional Contributor III

The topic of dates and times in web GIS is a loaded topic covered in many posts and blogs elsewhere.  I just encountered it in a Web AppBuilder application we are developing.  The dates in our application have no times and I configured the attributes in the layer popups to hide the times, since they should all be midnight.  By chance, I forgot to configure one correctly and I saw the datetime was 7 hours behind on the previous day, meaning it was taken as UTC and adjusted to the local time zone, when it was already in the local time zone.  Based on the web map JSON and research, I figured out enough that I needed to republish the map service and specify that all times are in the local time zone, probably with Daylight Saving Time adjustments.

The problem is that if I add the map service or its layers to a new web map in the Map Viewer, the dates and times display correctly, however, I already had configured a very large web map with lots of configuration and it does not automatically work.  I searched the web map JSON and I see nothing different between the two web maps.  There is no mention of the local timezone.  There is no block of timezone configuration.  I have no idea how to get my web map to pick up the timezone on the map service.

0 Kudos
1 Solution

Accepted Solutions
NathanHeickLACSD
Occasional Contributor III

The solution was to close Chrome completely and delete the browser cache.  Then, the changes showed up right away.

View solution in original post

0 Kudos
4 Replies
NathanHeickLACSD
Occasional Contributor III

The solution was to close Chrome completely and delete the browser cache.  Then, the changes showed up right away.

0 Kudos
TanuHoque
Esri Regular Contributor

@NathanHeickLACSD 

I figured out enough that I needed to republish the map service and specify that all times are in the local time zone, probably with Daylight Saving Time adjustments.

just an FYI, if you published your map service by reference (i.e. no copying data on the server during publishing process) then you'd not need to republish your map service. All you'd need to do is go the Manager site and update the service Date Fields Setting >> Time Zone property just the way you'd do for Max Record Counts etc.

 

A side note, since UC 2021 is around the corner, and if you are planning to attend, I'd like mention that we are going to have a tech session to talk in details on this topic. The tile of the session is 'ArcGIS: Working with Date-Time Data'. Hope to see you there.

NathanHeickLACSD
Occasional Contributor III

Thank you Tanu!  We've got the heavy hitter here today.  Yes, I have been to your sessions before.  I will plan on going.  Personally, I'm of the mind set that everything should be stored in UTC and converted back and forth to the local timezone by the client.  This would be like decoding all text into unicode when you input text, storing unicode in your application, and reencoding as necessary to output.  Even if someone's database stores local time, the local timezone should be defined somewhere and the client should handle the conversions.  I thought about this a lot several years ago, but I was kind of surprised that ArcGIS Pro was already addressing these issues.  I always hated using local time to store editor tracking dates, but it was so impractical to use UTC because the clients didn't convert the datetimes to the local timezone for you, so I always just reluctantly used database time.  I still haven't gotten into all of ArcGIS Pro yet, so this was the first time I bumped into the problem.  Also, I work with flow monitoring and things like DST are really a mess when you are collecting continuous time series data.  I will see you there.

0 Kudos
TanuHoque
Esri Regular Contributor

Thanks @NathanHeickLACSD for your feedback. Just a disclaimer: a power user like you might not learn new tricks in the session, but we'd like to learn your use cases (or the area you are struggling with) in the session. So that we can better serve you in upcoming releases. There will be a Q/A section at the end or as you know we can always meet afterward to discuss at length.

 

cc: @garymacdougallesri 

 

0 Kudos