<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Handle timezones in a datetime field in an archived database in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41282#M451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&amp;nbsp; Nothing specific at this point, it was just confirmation around the syncing process of the datetime fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Nov 2018 16:40:57 GMT</pubDate>
    <dc:creator>PaulFarrow1</dc:creator>
    <dc:date>2018-11-26T16:40:57Z</dc:date>
    <item>
      <title>Handle timezones in a datetime field in an archived database</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41278#M447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the datetime is stored in UTC and you are in a different timezone to the server - how should you handle the timezone issue.&amp;nbsp; When syncing the archived geodatabase to and from the server should that process handle the timezone manipulation?&amp;nbsp; Or how do people handle this?&amp;nbsp; I just don't seem to be able to make it work correctly in all scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2018 13:22:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41278#M447</guid>
      <dc:creator>PaulFarrow1</dc:creator>
      <dc:date>2018-11-20T13:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Handle timezones in a datetime field in an archived database</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41279#M448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The dates are read and stored in UTC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want dates displayed in local time, you can use `DateTimeOffset.ToLocalTime()` to convert the date attribute (in UTC)&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;DateTimeOffset&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Attributes&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"created_date"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToLocalTime&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And if you are querying for features and have local time as input, convert this first to UTC&amp;nbsp;before&amp;nbsp;setting query parameters.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; ld &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; DateTimeOffset&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Parse&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"11/20/2018 12:47:03 PM -08:00"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
p&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;WhereClause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;$&lt;SPAN class="string token"&gt;"created_date = '{ld.ToUniversalTime()}'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Was there a specific sync scenario where you don't find this to be working as expected?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:36:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41279#M448</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-10T21:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Handle timezones in a datetime field in an archived database</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41280#M449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Jennifer &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replying.&amp;nbsp; I think what I am after is there is nothing specific to syncing that would change a datetime field from local to server timezone datetime?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its basically read UTC to local then save local to UTC in your own code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2018 21:24:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41280#M449</guid>
      <dc:creator>PaulFarrow1</dc:creator>
      <dc:date>2018-11-20T21:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Handle timezones in a datetime field in an archived database</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41281#M450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, properties&amp;nbsp;of&amp;nbsp;DateTimeOffset type are converted by runtime API to UTC before it's stored or sync'd to server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if you have the following code... this local time will be converted to UTC.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Attributes&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"submitted"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; DateTimeOffset&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Now&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; t&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;UpdateFeatureAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If editor-tracking was enabled, the `created_date` and `last_edited_date`, auto-generated fields, are also stored in UTC. So if your app wants to display these date time attributes in local time, you'd have to call ToLocalTime(). Other date fields related to sync - like when you create geodatabase, the `replicaName` includes creation time is also in UTC or when you sync geodatabase,&amp;nbsp;the `submissionTime`, `lastUpdateTime` are also in UTC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My query sample above&amp;nbsp;with where clause on a date field may be the only other time app is responsible for converting local input to UTC because now we're dealing with text and not a date time object. If you should use QueryParameters.TimeExtent, since Start/End times are of DateTimeOffset type, they are expected to be converted by runtime API to UTC before it's sent for query to server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a specific case in mind that is not addressed here, I can check it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:36:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41281#M450</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-10T21:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Handle timezones in a datetime field in an archived database</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41282#M451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&amp;nbsp; Nothing specific at this point, it was just confirmation around the syncing process of the datetime fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2018 16:40:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/handle-timezones-in-a-datetime-field-in-an/m-p/41282#M451</guid>
      <dc:creator>PaulFarrow1</dc:creator>
      <dc:date>2018-11-26T16:40:57Z</dc:date>
    </item>
  </channel>
</rss>

