<?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: convert number with decimal in datetime in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/convert-number-with-decimal-in-datetime/m-p/880934#M10994</link>
    <description>&lt;P&gt;Excel counts days from a different starting point.&amp;nbsp; Excel stores time of day as a fraction of a day. You can use the DHMS() function to days (including fractional days) into datetime.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  datetime=dhms('30DEC1899'd+44824.689149,0,0,0);
  format datetime datetime19.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;317  data test;
318    datetime=dhms('30DEC1899'd+44824.689149,0,0,0);
319    format datetime datetime19.;
320    put datetime=;
321  run;

datetime=20SEP2022:16:32:22
&lt;/PRE&gt;</description>
    <pubDate>Thu, 15 Jun 2023 14:57:34 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-06-15T14:57:34Z</dc:date>
    <item>
      <title>convert number with decimal in datetime</title>
      <link>https://communities.sas.com/t5/SAS-Studio/convert-number-with-decimal-in-datetime/m-p/880932#M10993</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have this number&amp;nbsp;44824.689149 in sas table. If I put this it into an excel and format it in date time I get the following result is&amp;nbsp;20/09/2022 16:32:22.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do this in sas?&lt;/P&gt;&lt;P&gt;I try with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data test;
a=put(44824.689149,datetime16.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but I get: 01jan60:12:27:05&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Luca&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 14:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/convert-number-with-decimal-in-datetime/m-p/880932#M10993</guid>
      <dc:creator>luca87</dc:creator>
      <dc:date>2023-06-15T14:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: convert number with decimal in datetime</title>
      <link>https://communities.sas.com/t5/SAS-Studio/convert-number-with-decimal-in-datetime/m-p/880934#M10994</link>
      <description>&lt;P&gt;Excel counts days from a different starting point.&amp;nbsp; Excel stores time of day as a fraction of a day. You can use the DHMS() function to days (including fractional days) into datetime.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  datetime=dhms('30DEC1899'd+44824.689149,0,0,0);
  format datetime datetime19.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;317  data test;
318    datetime=dhms('30DEC1899'd+44824.689149,0,0,0);
319    format datetime datetime19.;
320    put datetime=;
321  run;

datetime=20SEP2022:16:32:22
&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Jun 2023 14:57:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/convert-number-with-decimal-in-datetime/m-p/880934#M10994</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-06-15T14:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: convert number with decimal in datetime</title>
      <link>https://communities.sas.com/t5/SAS-Studio/convert-number-with-decimal-in-datetime/m-p/960969#M11387</link>
      <description>I just posted this exact same problem with my own data set and then found your solution. Thank you!</description>
      <pubDate>Wed, 05 Mar 2025 17:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/convert-number-with-decimal-in-datetime/m-p/960969#M11387</guid>
      <dc:creator>abaker_ca</dc:creator>
      <dc:date>2025-03-05T17:23:13Z</dc:date>
    </item>
  </channel>
</rss>

