<?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: Get date and time value from Epoch in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Get-date-and-time-value-from-Epoch/m-p/884007#M349231</link>
    <description>&lt;P&gt;Thank you so much, Tom.&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2023 19:22:38 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2023-07-07T19:22:38Z</dc:date>
    <item>
      <title>Get date and time value from Epoch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-date-and-time-value-from-Epoch/m-p/884001#M349227</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I would like to get date and time from Epoch value such as:&lt;/P&gt;
&lt;P&gt;1688750835759&lt;/P&gt;
&lt;P&gt;will give date: 07JUL2023&amp;nbsp; and GMT time: 17&lt;SPAN&gt;:27:15.759&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you please help?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you so much.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;HHC&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;format epoch comma32.;
input epoch;
datalines;
1688750835759
;
run;

data test;set test;
*format dt datetime24.3;
drop dt seconds;
format date date9.;
format clock_time time9.;

seconds=epoch/1000;
dt = seconds + '01JAN1970:00:00'dt ;
date=datepart(dt);
clock_time=timepart(dt);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jul 2023 19:22:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-date-and-time-value-from-Epoch/m-p/884001#M349227</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2023-07-07T19:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get date and time value from Epoch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-date-and-time-value-from-Epoch/m-p/884003#M349228</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/EPOCH-Time-conversion/m-p/104155#M9092" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/EPOCH-Time-conversion/m-p/104155#M9092&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 18:27:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-date-and-time-value-from-Epoch/m-p/884003#M349228</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-07T18:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get date and time value from Epoch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-date-and-time-value-from-Epoch/m-p/884004#M349229</link>
      <description>&lt;P&gt;Just convert the milliseconds to seconds and add the number seconds between 1960 and 1970.&lt;/P&gt;
&lt;PRE&gt;251  data test;
252   epoch=1688750835759 ;
253   seconds=epoch/1000;
254   dt = seconds + '01JAN1970:00:00'dt ;
255   put epoch= comma32. / seconds=comma32.3 / dt=datetime24.3 ;
256  run;

epoch=1,688,750,835,759
seconds=1,688,750,835.759
dt=07JUL2023:17:27:15.759
&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jul 2023 18:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-date-and-time-value-from-Epoch/m-p/884004#M349229</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-07T18:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get date and time value from Epoch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-date-and-time-value-from-Epoch/m-p/884007#M349231</link>
      <description>&lt;P&gt;Thank you so much, Tom.&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 19:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-date-and-time-value-from-Epoch/m-p/884007#M349231</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2023-07-07T19:22:38Z</dc:date>
    </item>
  </channel>
</rss>

