<?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: Getting Date from version 10 using 1.2 api in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getting-date-from-version-10-using-1-2-api/m-p/106288#M2681</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like an Unix time &lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;based on seconds since standard epoch of 1/1/1970 (or in ms in your case)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size:2;"&gt;You can get the date with : &lt;BR /&gt;&lt;SPAN style="color: black; font-size: 2; font-family: Tahoma;"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 2; font-family: Tahoma;"&gt; dt = UnixTimeToDateTime(1144368000000 / 1000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UnixTimeToDateTime method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
private static DateTime origin = new DateTime(1970, 1, 1);
public static DateTime UnixTimeToDateTime(long timespan)
{
&amp;nbsp; return origin.AddSeconds(timespan);
} 
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 06:28:12 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2021-12-11T06:28:12Z</dc:date>
    <item>
      <title>Getting Date from version 10 using 1.2 api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getting-date-from-version-10-using-1-2-api/m-p/106287#M2680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do I convert 1144368000000 to 4/7/2006 ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have a mapservice that is using ArcGIS 10. We are are using the 1.2 arcgis silverlight api.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The identify task is returning readable dates, however the query task is returning dates in a long format. I can replicate the results by using the browser query task against the RestAPI. If I return JSON I get 1144368000000, however if I return HTML i see the date 4/7/2006.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have not been able to figure out how to get this to convert. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried assuming this is Ticks so doing...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DateTime dt = new DateTime(1144368000000);&amp;nbsp; but that doesn't work. (it only works out to a day and a half of ticks)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Both of these options return 1/2/1601 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DateTime stest = DateTime.FromFileTime(1144368000000) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DateTime stest2 = DateTime.FromFileTimeUtc(1144368000000) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also tried pushing it into a JSONValue and JSONObject but without success. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see there is a new DateTimeConverter class in the 2.0 version (ESRI.ArcGIS.Client.Toolkit.Utilities), but surely there is a way to get this to convert without having to upgrade the API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;casey&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Sep 2010 20:50:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getting-date-from-version-10-using-1-2-api/m-p/106287#M2680</guid>
      <dc:creator>caseycupp</dc:creator>
      <dc:date>2010-09-03T20:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Date from version 10 using 1.2 api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getting-date-from-version-10-using-1-2-api/m-p/106288#M2681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like an Unix time &lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;based on seconds since standard epoch of 1/1/1970 (or in ms in your case)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size:2;"&gt;You can get the date with : &lt;BR /&gt;&lt;SPAN style="color: black; font-size: 2; font-family: Tahoma;"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 2; font-family: Tahoma;"&gt; dt = UnixTimeToDateTime(1144368000000 / 1000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UnixTimeToDateTime method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
private static DateTime origin = new DateTime(1970, 1, 1);
public static DateTime UnixTimeToDateTime(long timespan)
{
&amp;nbsp; return origin.AddSeconds(timespan);
} 
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getting-date-from-version-10-using-1-2-api/m-p/106288#M2681</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T06:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Date from version 10 using 1.2 api</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getting-date-from-version-10-using-1-2-api/m-p/106289#M2682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That was perfect..I was so close but kept missing. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Sep 2010 02:30:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getting-date-from-version-10-using-1-2-api/m-p/106289#M2682</guid>
      <dc:creator>caseycupp</dc:creator>
      <dc:date>2010-09-07T02:30:42Z</dc:date>
    </item>
  </channel>
</rss>

