Hi,
So when saving to a "Date" type field, does it always convert the time to UTC, or does it just store the date/time as whatever is fed/typed in.
For example, in a VertiGIS Mobile application I am working on we are auto setting the Inspection Date field in a form with = Date.Now(), but when the form saves to the table in our SDE it seems to be saving 4 hours ahead. So what should be 9/21/2023 @ 8:22AM actually shows up in the data as 9/21/2023 @ 12:22PM.
Can anyone explain what might be going on??
Solved! Go to Solution.
@BrianBulla Although I am not knowledgeable in VertiGIS Mobile application; the typical mobile app would work off a feature service. There are many configuration parameters at the feature service, one of them being Date/Time.
In the Publish Map Service pane, on the Configuration tab, click the Configure Parameters, under Date Fields, click the Time zone of the data drop-down arrow and choose the time zone in which your date values are stored. Specifying the time zone in which the dates are recorded allows date and time values to be converted correctly when users interact with the service.
You only need to choose a time zone if your map contains layers with date fields. If you don't specify a time zone, the dates are assumed to be stored in UTC.
Reference: Configure a map service
Sounds like a time zone thing; most of the time they save as UTC.
my understanding is that most web based applications are going to default to using UTC unless you tell the app to do differently. Is +4 hours the UTC offset for where you are at? You may also have to consider Daylight Savings in this. I'm not familiar with VertiGIS, but you may want to reach out to their customer service or help to confirm how dates are calculated and if there are ways to force local time into your field.
Hi. We are in EST, which normally is -5, but maybe with daylight savings that is why it is at -4?? That whole topic of DST vs normal time is confusing enough!! 🙂
@BrianBulla Although I am not knowledgeable in VertiGIS Mobile application; the typical mobile app would work off a feature service. There are many configuration parameters at the feature service, one of them being Date/Time.
In the Publish Map Service pane, on the Configuration tab, click the Configure Parameters, under Date Fields, click the Time zone of the data drop-down arrow and choose the time zone in which your date values are stored. Specifying the time zone in which the dates are recorded allows date and time values to be converted correctly when users interact with the service.
You only need to choose a time zone if your map contains layers with date fields. If you don't specify a time zone, the dates are assumed to be stored in UTC.
Reference: Configure a map service
Hi. So updating the Time Zone on the webservice is now saving the proper date/time in to our table in SDE. Thanks for the tip!!
Thanks everyone. I am working with the support at VertiGIS too, so hopefully I'll get this figured out soon. Lots of options to look in to.