<?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: Converting 11 digit to date value in SAS in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879426#M43081</link>
    <description>&lt;P&gt;Why do you think that value should be 5 Jun 2023? Where did that 11 digit value come from?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a datetime value is supposed to be 5 Jun 2023 it would start at 2001542400.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a value is a datetime, i.e. with seconds involved, you could request the SAS date value using the DATEPART function, and assign a date format for readability. That value with the Datepart function will return 4 Jun 2013 though.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2023 18:56:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-06-06T18:56:22Z</dc:date>
    <item>
      <title>Converting 11 digit to date value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879422#M43079</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking to see how to convert a 11 digit number to a date value?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;1685937600&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this code -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;xdate = put(1685937600, datetime20.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However my output is&amp;nbsp; 04JUN2013:04:00:00&lt;/P&gt;&lt;P&gt;When it should be June 5th 2023&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 18:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879422#M43079</guid>
      <dc:creator>y1232</dc:creator>
      <dc:date>2023-06-06T18:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Converting 11 digit to date value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879424#M43080</link>
      <description>&lt;P&gt;I don't see how this value of&amp;nbsp;&lt;SPAN&gt;1685937600 can be June 5, 2023. You need to explain how you got June 5, 2023 as the correct answer.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 18:53:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879424#M43080</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-06T18:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Converting 11 digit to date value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879426#M43081</link>
      <description>&lt;P&gt;Why do you think that value should be 5 Jun 2023? Where did that 11 digit value come from?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a datetime value is supposed to be 5 Jun 2023 it would start at 2001542400.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a value is a datetime, i.e. with seconds involved, you could request the SAS date value using the DATEPART function, and assign a date format for readability. That value with the Datepart function will return 4 Jun 2013 though.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 18:56:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879426#M43081</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-06-06T18:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Converting 11 digit to date value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879428#M43082</link>
      <description>&lt;P&gt;Your date is using a starting base of 01Jan1970, but SAS uses 01Jan1960.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if there's an easier fix than this.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options c
data test;
x=1685937600;
xdate = put(1685937600, datetime20.);
xdate2 = x + dhms('01Jan1970'd,0,0,0)-dhms('01Jan1960'd,0,0,0);
format xdate2 datetime20.;
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Jun 2023 19:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879428#M43082</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-06T19:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Converting 11 digit to date value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879439#M43083</link>
      <description>&lt;P&gt;Yes this actually worked - it does show a time of 4:00 am however it works for me!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 20:05:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879439#M43083</guid>
      <dc:creator>y1232</dc:creator>
      <dc:date>2023-06-06T20:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Converting 11 digit to date value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879452#M43084</link>
      <description>&lt;P&gt;The extra 4 hours is probably because the date is using GMT and your system is in some other time zone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 22:18:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879452#M43084</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-06-06T22:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Converting 11 digit to date value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879453#M43085</link>
      <description>&lt;P&gt;There is no need to make the function call just use a datetime literal instead of date literal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;xdate2 = x + '01Jan1970:00:00:00'dt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also there is no need to subtract the zero from the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 22:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-11-digit-to-date-value-in-SAS/m-p/879453#M43085</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-06-06T22:21:37Z</dc:date>
    </item>
  </channel>
</rss>

