<?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 timestamp in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965291#M375821</link>
    <description>&lt;P&gt;I have a data field 'TimeStamp' that I've imported via API that appears as&amp;nbsp;1.7454672E12. The information published states the field is '&lt;SPAN&gt;&amp;nbsp;Either a date with the format YYYY-MM-DD or a millisecond timestamp.'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'd appreciate any thoughts on a SAS format that can help me understand what this value is.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Apr 2025 18:51:39 GMT</pubDate>
    <dc:creator>Lost_Gary</dc:creator>
    <dc:date>2025-04-28T18:51:39Z</dc:date>
    <item>
      <title>timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965291#M375821</link>
      <description>&lt;P&gt;I have a data field 'TimeStamp' that I've imported via API that appears as&amp;nbsp;1.7454672E12. The information published states the field is '&lt;SPAN&gt;&amp;nbsp;Either a date with the format YYYY-MM-DD or a millisecond timestamp.'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'd appreciate any thoughts on a SAS format that can help me understand what this value is.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 18:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965291#M375821</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2025-04-28T18:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965292#M375822</link>
      <description>&lt;P&gt;So your timestamp is about 1.7 trillion, whereas the timestamp of today (April 28, 2025) is approx 2 billion, about 1,000 times smaller than the timestamp you show. So if your timestamp is in milliseconds, then you would divide by 1,000 to turn it into seconds, and then use a datetime format to convert it to a date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
    timestamp=datetime();
    output;
    timestamp=1.7454672E12/1000;
    output;
    format timestamp dtdate9.; /* Or use whatever datetime format you want */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 19:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965292#M375822</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-04-28T19:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965293#M375823</link>
      <description>&lt;P&gt;Do you know what the correct date or date-time value is, which this value represents?&amp;nbsp; If it is a millisecond timestamp, is it number of milliseconds since what zero point?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's number of milliseconds, you could convert it to number of seconds, but you need to know the zero point.&amp;nbsp; If the&amp;nbsp; 0 is Jan 1, 1960, then it would represent 24Apr2015 at 4:00am:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;18   data a ;
19     x=1.7454672E12 ;
20     x=x/1000 ;
21     format x datetime19. ;
22     put x= ;
23   run ;

x=24APR2015:04:00:00
NOTE: The data set WORK.A has 1 observations and 1 variables.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 19:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965293#M375823</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-04-28T19:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965295#M375825</link>
      <description>&lt;P&gt;Good point, we don't know the zero point for this information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Minor quibble, which I was going to mention in my other post&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The value&amp;nbsp;1.7454672E12 is almost definitely a truncated value, it almost definitely is not the actual time that the timestamp was taken (not a good way to transmit information) because there are only 8 significant digits. So it&lt;SPAN&gt;&amp;nbsp;would represent 24Apr2015 at 4:00am, plus or minus a few hours (which I am too lazy to calculate exactly).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 19:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965295#M375825</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-04-28T19:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965338#M375829</link>
      <description>&lt;P&gt;Unix timestamps use 1970 as the base date.&lt;/P&gt;
&lt;PRE&gt;65   data test;
66     ts=1.7454672E12;
67     dt='01JAN1970:00:00'dt + ts/1000;
68     put ts=comma20./ dt=datetime26.6;
69   run;

ts=1,745,467,200,000
dt=24APR2025:04:00:00.000000
&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Apr 2025 03:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/timestamp/m-p/965338#M375829</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-04-29T03:50:41Z</dc:date>
    </item>
  </channel>
</rss>

