<?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: DateTime wrong after FeatureService Editing in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268006#M6997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In javascript&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;new Date().getTime() - (3600000 * 5);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Feb 2012 18:31:17 GMT</pubDate>
    <dc:creator>gisscconsulting</dc:creator>
    <dc:date>2012-02-01T18:31:17Z</dc:date>
    <item>
      <title>DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267994#M6985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an application that edits using a FeatureService.&amp;nbsp; Whenever an edit is made, a Date Field is populated with "DateTime.Now"&amp;nbsp; When debugging, the time is correct at every step, but when I check the featureclass that was edited in the sde using ArcCatalog or ArcMap...the time portion of the DateTime is 5 hours ahead of the current time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, if I make an edit today at 3pm, the date being sent will be today at 3pm, but the date that ends up in the featureclass is today at 8pm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm at a complete loss here as to why this is happening.&amp;nbsp; Does anybody have any ideas?&amp;nbsp; This is going to cause lots of problems if I can't get this fixed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 13:58:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267994#M6985</guid>
      <dc:creator>WilliamKimrey</dc:creator>
      <dc:date>2011-06-10T13:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267995#M6986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What are you using to edit the DateTime field? Could this be a related thread? &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/16644-Date-Conversion-Problems-REST-lt-gt-Silverlight"&gt;http://forums.arcgis.com/threads/16644-Date-Conversion-Problems-REST-lt-gt-Silverlight&lt;/A&gt;&lt;SPAN&gt; What version of the API are you using. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are not using FeatureDataForm or FeatureDataGrid, try to specify DateTime.Kind when you set the DateTime attribute.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2011 19:05:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267995#M6986</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-06-13T19:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267996#M6987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using v2.1 of the API and I'm editing the attribute using a FeatureDateForm (sort of).&amp;nbsp; The FeatureLayer Outfields don't include the Date field that I'm editing because we don't want the user to see that in the FeatureDataForm.&amp;nbsp; But, before we apply the changes in the form, I do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureDataForm fdf = (FeatureDataForm)sender;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fdf.GraphicSource.Attributes["EDITOR"] = username;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fdf.GraphicSource.Attributes["EDITED_DATE"] = DateTime.Now;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fdf.ApplyChanges();
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using Fiddler, I saw that this was sent in the updates for the EDITED_DATE field "1307997114182" and what was saved in the database was "6/13/3011 8:31:54 PM".&amp;nbsp; The time should be 3:51 PM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not really sure how that number breaks down into the date, but maybe you can tell me if the data being sent is correct or not and what to do if it isn't.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:07:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267996#M6987</guid>
      <dc:creator>WilliamKimrey</dc:creator>
      <dc:date>2021-12-11T13:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267997#M6988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There was a bug fix in FeatureDataForm and FeatureDataGrid that dates back to 11/2010. I believe this was part of v2.1 release. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After you have selected a Date from the DatePicker in FeatureDataForm, can you verify that the Date value has DateTime.Kind of Utc? If this is still Unspecified, then this might be causing the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The long number that you see is the equivalent long value for the DateTime. This should be correct as long as the DateTime have a specified kind.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 00:49:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267997#M6988</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-06-16T00:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267998#M6989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When populating the date with "DateTime.Now". the DateTime.Kind is "Local".&amp;nbsp; I switched over to using "DateTime.UtcNow" which does have a Kind of "Utc", but that resulted in the same issue.&amp;nbsp; In both cases, the time that my sde database shows in the featureclass is hours ahead of the current time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:09:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267998#M6989</guid>
      <dc:creator>WilliamKimrey</dc:creator>
      <dc:date>2011-06-16T12:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267999#M6990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;FeatureDataForm fdf = (FeatureDataForm)sender;&lt;BR /&gt;fdf.GraphicSource.Attributes["EDITOR"] = username;&lt;BR /&gt;fdf.GraphicSource.Attributes["EDITED_DATE"] = DateTime.Now;&lt;BR /&gt;fdf.ApplyChanges();&lt;BR /&gt;&lt;BR /&gt;Using Fiddler, I saw that this was sent in the updates for the EDITED_DATE field "1307997114182" and what was saved in the database was "6/13/&lt;STRONG&gt;3011&lt;/STRONG&gt; 8:31:54 PM".&amp;nbsp; The time should be 3:51 PM.&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Does your date actually say 2011 or 3011? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) before you set "EDITED_DATE" does the attribute contain a DateTime mm/dd/yyyy or a Long(Ticks) 1307997114182&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) When you commit your save are you wired up to the Failed event handler.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 15:35:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/267999#M6990</guid>
      <dc:creator>ChristopherHill</dc:creator>
      <dc:date>2011-06-16T15:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268000#M6991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1) Yes, I did mean 2011.&amp;nbsp; Sorry about that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Before setting the attribute with the new DateTime, it does have a DateTime (mm/dd/yyy tt:tt:tt AM) object.&amp;nbsp; This object includes the Day, Day of the Week, Kind, Hour, Ticks, etc.&amp;nbsp; There's a bunch of stuff in there.&amp;nbsp; The Date part of it is fine.&amp;nbsp; It's the TimeOfDay part that gets messed up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Yes, the Save Failed event is wired up, but it's never triggered.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I put a break point and debug at the point where the attribute is assigned, I can see that the "DateTime.Now" contains the correct information while the "DateTime.UtcNow" has the wrong information.&amp;nbsp; It seems that even though I"m assigning the first value, it's actually saving the last value.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 15:49:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268000#M6991</guid>
      <dc:creator>WilliamKimrey</dc:creator>
      <dc:date>2011-06-16T15:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268001#M6992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This may be the problem the FeatureDataForm only edits the "Date" portion of DateTime. Currently the FeatureDataForm uses a DatePicker control for editing. the DatePicker control only changes the Date it will not update the time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Original value : 1/1/2011 5:00:00 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DatePicker shows 1/1/2011 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Modified value : 5/5/2011 12:00:00 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DatePicker shows 5/5/2011&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ApplyChanges()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the date gets modified but the original value is not changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Result : 5/5/2011 5:00:00 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you confirm that this is what is happening. Does the time protion ever change?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 16:09:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268001#M6992</guid>
      <dc:creator>ChristopherHill</dc:creator>
      <dc:date>2011-06-16T16:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268002#M6993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That is not what is happening in this case.&amp;nbsp; The time portion is changing.&amp;nbsp; Also, this is not unique to the DatePicker .&amp;nbsp; I have instances where I'm changing the attribute in the code-behind by assigning "DateTime.Now" to it and bypassing the FeatureDataForm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, this problem occurs regardless of the method.&amp;nbsp; Here's the scenario.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Original Value (edited in ArcMap so it has correct time) =&amp;gt; 6/16/2011 1:12:35 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Assign DateTime.Now to the feature's attribute (using silverlight app)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; 2a) Before Saving, After ApplyChanges =&amp;gt; 6/16/2011 1:15:40 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; 2b) During FeatureLayer_EndSaveEdits =&amp;gt; 6/16/2011 1:15:40 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Database now reads 6/16/2011 6:15:40 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; 3a) When I edit the feature again, this is the value that I get.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instances where I use the DatePicker don't need to have exact time because I really just need to know the day.&amp;nbsp; However, this field is what we use to track when edits are made to the data so in the event that something happens, we can tell the user things like "We have the data you entered before lunch, but everything after 1:00 PM will need to be re-entered".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 17:31:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268002#M6993</guid>
      <dc:creator>WilliamKimrey</dc:creator>
      <dc:date>2011-06-16T17:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268003#M6994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have the same problem. Any solution?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 13:00:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268003#M6994</guid>
      <dc:creator>JoãoMendes</dc:creator>
      <dc:date>2011-08-12T13:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268004#M6995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There really isn't a solution, just a workaround.&amp;nbsp; I have to offset the date that I'm saving by the number of hours that get added.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, in my case, since it's adding 5 hours to my time, I went from using "DateTime.Now;" to using "DateTime.Now.AddHours(-5.0);".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It was explained to me at the IUC that while the application will show the correct time and appear to send the correct time to the database, the base functionality of using REST will always use UTC time instead of local time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 13:29:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268004#M6995</guid>
      <dc:creator>WilliamKimrey</dc:creator>
      <dc:date>2011-08-12T13:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268005#M6996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I came across this same problem. To take into consideration different local times and daylight savings, I used this to correct the times:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private DateTime CorrectDateTime(DateTime dateTime)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; return dateTime.Subtract(dateTime.ToUniversalTime().Subtract(dateTime));
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgis rest services edit datetime universal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:07:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268005#M6996</guid>
      <dc:creator>MatthewDickinson</dc:creator>
      <dc:date>2021-12-11T13:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268006#M6997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In javascript&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;new Date().getTime() - (3600000 * 5);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 18:31:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268006#M6997</guid>
      <dc:creator>gisscconsulting</dc:creator>
      <dc:date>2012-02-01T18:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime wrong after FeatureService Editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268007#M6998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This issue has to do with DateTimeKind.Unspecified, DateTimeKind.Local, DateTimeKind.UTC&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you create a DateTime using DateTime.Now you get DateTimeKind.Unspecified which is represented in your local timezone, when you save this to the database it gets saved conveterd to UTC, then when you get it back you must convert it back to Unspecified or Local before you display it (if that is your desired format).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;client (create new date)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; database (UTC) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1/1/2011 12:00:00am local(PST -8 hrs) - &amp;gt;&amp;nbsp;&amp;nbsp; 1/1/2011 8am UTC&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1/1/2011 8:00:00am UTC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;-&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2011 8am UTC&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the client side it is up to the user to either make sure that when they show the DateTime they are consistently showing the same DateTimeKind otherwise the user will get the impression that the date is wrong when its not, its just being shown in a different unit of measurement then they orignially started with.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;think of it this way&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;client&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; database&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 meter&amp;nbsp; -&amp;gt;&amp;nbsp;&amp;nbsp; 3 feet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 feet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;-&amp;nbsp;&amp;nbsp; 3 feet&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the problem is the user only see the value and not the unit of measurement in which the value is being displayed, which makes it seem like the data has changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We are adding the ability for the user to control what DateTimeKind they want the client to see for example (FeatureDataGrid.DateTimeKind = DateTimeKind.Local)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;we will assume that with this value the user wants all dates represented in local time and we will make sure all UTC dates are converter to Local before displaying inside FeatureDataGrid. If you however choose to diplay the date somewhere else or within your own control you will have to handle making sure that the DateTimeKind is consistent for what you would like the user to see. The conversions use DateTime.ToLocal() and DateTime.ToUniversal()&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 16:11:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datetime-wrong-after-featureservice-editing/m-p/268007#M6998</guid>
      <dc:creator>ChristopherHill</dc:creator>
      <dc:date>2012-02-02T16:11:25Z</dc:date>
    </item>
  </channel>
</rss>

