<?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 DateTime conversion of exported CSV file type 1549663223992.0  in Admin Tools Questions</title>
    <link>https://community.esri.com/t5/admin-tools-questions/datetime-conversion-of-exported-csv-file-type/m-p/788645#M22</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got an automated process started that downloads a Feature Layer Collection from an AGOL account for clean-up and rewrite.&amp;nbsp; Comes down just fine as a CSV but the dates come down as a large number that I can convert using float.&amp;nbsp; I'm unable to come across any way to convert this in Python (3.7) to make it a usable DateTime feature.&amp;nbsp; Can you point me towards a way to accomplish this.&amp;nbsp; Neither of the lines of code below do anything with the number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ndt_value = (datetime.datetime(float(date_value), dateFormat=u'%m/%d/%Y', timeFormat=u'%I:%M:%S %p')&lt;BR /&gt;ndt_value = time.strptime(float(date_value), "%d %b %y")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They all come across looking like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dte1 &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; dte2&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; font-family: monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: inherit; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-break: break-all; word-spacing: 0px;"&gt;value 1549492620000.0 1549663223992.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; font-family: monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: inherit; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-break: break-all; word-spacing: 0px;"&gt;value 1549493100000.0 1549661829963.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; font-family: monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: inherit; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-break: break-all; word-spacing: 0px;"&gt;value 1549493220000.0 1554867569006.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; font-family: monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: inherit; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-break: break-all; word-spacing: 0px;"&gt;value 1549394280000.0 1554867776915.0&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Apr 2019 22:05:22 GMT</pubDate>
    <dc:creator>JackieFisher</dc:creator>
    <dc:date>2019-04-10T22:05:22Z</dc:date>
    <item>
      <title>DateTime conversion of exported CSV file type 1549663223992.0</title>
      <link>https://community.esri.com/t5/admin-tools-questions/datetime-conversion-of-exported-csv-file-type/m-p/788645#M22</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got an automated process started that downloads a Feature Layer Collection from an AGOL account for clean-up and rewrite.&amp;nbsp; Comes down just fine as a CSV but the dates come down as a large number that I can convert using float.&amp;nbsp; I'm unable to come across any way to convert this in Python (3.7) to make it a usable DateTime feature.&amp;nbsp; Can you point me towards a way to accomplish this.&amp;nbsp; Neither of the lines of code below do anything with the number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ndt_value = (datetime.datetime(float(date_value), dateFormat=u'%m/%d/%Y', timeFormat=u'%I:%M:%S %p')&lt;BR /&gt;ndt_value = time.strptime(float(date_value), "%d %b %y")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They all come across looking like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dte1 &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; dte2&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; font-family: monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: inherit; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-break: break-all; word-spacing: 0px;"&gt;value 1549492620000.0 1549663223992.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; font-family: monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: inherit; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-break: break-all; word-spacing: 0px;"&gt;value 1549493100000.0 1549661829963.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; font-family: monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: inherit; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-break: break-all; word-spacing: 0px;"&gt;value 1549493220000.0 1554867569006.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; font-family: monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: inherit; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-break: break-all; word-spacing: 0px;"&gt;value 1549394280000.0 1554867776915.0&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 22:05:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/admin-tools-questions/datetime-conversion-of-exported-csv-file-type/m-p/788645#M22</guid>
      <dc:creator>JackieFisher</dc:creator>
      <dc:date>2019-04-10T22:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime conversion of exported CSV file type 1549663223992.0</title>
      <link>https://community.esri.com/t5/admin-tools-questions/datetime-conversion-of-exported-csv-file-type/m-p/788646#M23</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/227899" target="_blank"&gt;Jackie Fisher&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The date values in your output are epoch timestamps in&amp;nbsp;milliseconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #252830; background-color: #ffffff;"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE&gt;time.ctime()&lt;/CODE&gt;&lt;SPAN style="color: #252830; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function takes seconds passed since epoch as an argument and returns a string representing local time. So, you have to divide your values by thousand, like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; time

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ctime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1549492620000.0&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Output will be:&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Wed Feb 06 23:37:00 2019&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;&lt;/P&gt;&lt;P&gt;For a quick, manual conversion of an epoch timestamp you can have a look at this website:&amp;nbsp;&lt;A class="link-titled" href="https://www.epochconverter.com/" title="https://www.epochconverter.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;https://www.epochconverter.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Egge-Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:00:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/admin-tools-questions/datetime-conversion-of-exported-csv-file-type/m-p/788646#M23</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2021-12-12T09:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime conversion of exported CSV file type 1549663223992.0</title>
      <link>https://community.esri.com/t5/admin-tools-questions/datetime-conversion-of-exported-csv-file-type/m-p/788647#M24</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You.&amp;nbsp; It was just driving me crazy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 17:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/admin-tools-questions/datetime-conversion-of-exported-csv-file-type/m-p/788647#M24</guid>
      <dc:creator>JackieFisher</dc:creator>
      <dc:date>2019-04-11T17:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime conversion of exported CSV file type 1549663223992.0</title>
      <link>https://community.esri.com/t5/admin-tools-questions/datetime-conversion-of-exported-csv-file-type/m-p/788648#M25</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please feel free to mark the answer as correct if your issue is being solved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 17:55:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/admin-tools-questions/datetime-conversion-of-exported-csv-file-type/m-p/788648#M25</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2019-04-11T17:55:31Z</dc:date>
    </item>
  </channel>
</rss>

