<?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: Date to Datetime in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260355#M269049</link>
    <description>&lt;PRE&gt;data want;
  set have;
  new_variable=dhms(your_date,0,0,0);
  format new_variable datetime.;         &amp;lt;--- Modify this format assigning
run;&lt;/PRE&gt;</description>
    <pubDate>Thu, 31 Mar 2016 09:34:46 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-03-31T09:34:46Z</dc:date>
    <item>
      <title>Date to Datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260345#M269045</link>
      <description>&lt;P&gt;I need to turn all of my date variables to datetime in the format YYYY-MM-DD HH:MM:SS is there a quick way to do this?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 08:58:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260345#M269045</guid>
      <dc:creator>mk131190</dc:creator>
      <dc:date>2016-03-31T08:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Date to Datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260348#M269046</link>
      <description>&lt;P&gt;You would need to specify the missing components, for example:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  new_variable=dhms(your_date,0,0,0);
  format new_variable datetime.;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Mar 2016 09:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260348#M269046</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-31T09:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date to Datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260350#M269047</link>
      <description>&lt;P&gt;Are there any other datetime options? This gives DDMMMYY:HH:MM:SS which isnt the one I needed.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 09:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260350#M269047</guid>
      <dc:creator>mk131190</dc:creator>
      <dc:date>2016-03-31T09:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Date to Datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260353#M269048</link>
      <description>&lt;P&gt;There are plenty: &lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n0p2fmevfgj470n17h4k9f27qjag.htm" target="_self"&gt;Formats by Category&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if none fit your bill you can roll your own. Look at PROC FORMAT, specifically te PICTURE statement with the DATATYPE=DATETIME directive. It knows no&amp;nbsp;bounds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 09:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260353#M269048</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-03-31T09:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Date to Datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260355#M269049</link>
      <description>&lt;PRE&gt;data want;
  set have;
  new_variable=dhms(your_date,0,0,0);
  format new_variable datetime.;         &amp;lt;--- Modify this format assigning
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Mar 2016 09:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260355#M269049</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-31T09:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Date to Datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260356#M269050</link>
      <description>&lt;P&gt;And I almost forgot: a variable is not in a specific format. It can be a numeric variable with the presentation lossely coupled. You can present your data in any format without actually modyfying the values in the table. data and presentation are separate unless you choose to store the dates as character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 09:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260356#M269050</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-03-31T09:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Date to Datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260362#M269051</link>
      <description>&lt;P&gt;That's perfect thanks both.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 10:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Datetime/m-p/260362#M269051</guid>
      <dc:creator>mk131190</dc:creator>
      <dc:date>2016-03-31T10:05:29Z</dc:date>
    </item>
  </channel>
</rss>

