<?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: How to convert to Datetime? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-to-Datetime/m-p/74543#M21640</link>
    <description>You already have the answer you needed.  Now, if you want to learn more about working with dates, times and datetimes in SAS, take a look at:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi25/25/btu/25p058.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi25/25/btu/25p058.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art</description>
    <pubDate>Fri, 24 Sep 2010 18:07:40 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2010-09-24T18:07:40Z</dc:date>
    <item>
      <title>How to convert to Datetime?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-to-Datetime/m-p/74540#M21637</link>
      <description>My code is below, and I am trying to convert a MMDDYY var to DATETIME19.,but getting unreasonable value. example:&lt;BR /&gt;
&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
   x=today();&lt;BR /&gt;
   put x= date.;&lt;BR /&gt;
   put x1= datetime.;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
This code produces the following:&lt;BR /&gt;
&lt;BR /&gt;
  X=12/01/2010&lt;BR /&gt;
  X1=01JAN60:04:02:23&lt;BR /&gt;
&lt;BR /&gt;
is there any way to avoid the non valid value of X1?&lt;BR /&gt;
Please help</description>
      <pubDate>Fri, 24 Sep 2010 17:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-to-Datetime/m-p/74540#M21637</guid>
      <dc:creator>ren2010</dc:creator>
      <dc:date>2010-09-24T17:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert to Datetime?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-to-Datetime/m-p/74541#M21638</link>
      <description>The today() function returns a date value, not a datetime value. Use the datetime() function instead.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000200627.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000200627.htm&lt;/A&gt;

Message was edited by: Tim@SAS</description>
      <pubDate>Fri, 24 Sep 2010 18:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-to-Datetime/m-p/74541#M21638</guid>
      <dc:creator>Tim_SAS</dc:creator>
      <dc:date>2010-09-24T18:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert to Datetime?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-to-Datetime/m-p/74542#M21639</link>
      <description>Date variables are days since 1/1/1960.  Datetime variables are seconds since 1/1/1960.  So lets say x=2.  If we display x with a date format we would ge two days past 1/1/1960 (1/3/1960).  If we display x with a datetime format we get two seconds past midnight on 1/1/1960 00:00:02.</description>
      <pubDate>Fri, 24 Sep 2010 18:04:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-to-Datetime/m-p/74542#M21639</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-09-24T18:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert to Datetime?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-to-Datetime/m-p/74543#M21640</link>
      <description>You already have the answer you needed.  Now, if you want to learn more about working with dates, times and datetimes in SAS, take a look at:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi25/25/btu/25p058.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi25/25/btu/25p058.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art</description>
      <pubDate>Fri, 24 Sep 2010 18:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-to-Datetime/m-p/74543#M21640</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-09-24T18:07:40Z</dc:date>
    </item>
  </channel>
</rss>

