<?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 character date into date format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-date-into-date-format/m-p/805397#M317263</link>
    <description>&lt;P&gt;That T means you need a quite different informat:&lt;/P&gt;
&lt;PRE&gt;data example;
  x='2018-04-19T06:16';
  dt = input(x,e8601dt.);
  format dt datetime.;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/leforinforref/p0jd9jaqmxd2ezn1kncmpgfqcpiz.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/vdmmlcdc/1.0/leforinforref/p0jd9jaqmxd2ezn1kncmpgfqcpiz.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the link you used is for FORMATS, to display values, not read them. Just needed to go down the page a bit further but experience is what lets some of us recognize when you need one of the E8601 or B8601 type informats.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2022 20:52:43 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-03-31T20:52:43Z</dc:date>
    <item>
      <title>Convert character date into date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-date-into-date-format/m-p/805392#M317259</link>
      <description>&lt;P&gt;I have dates of this format: '2018-04-19T06:16' stored as $16 (format) and $200 (informat). I want to create a separate date (date9) and time (time5) from this.&lt;/P&gt;
&lt;P&gt;I tried the following code but ended up with "NOTE: Invalid argument to function INPUT". I assume the issue may be the format I am attempting to give it is wrong, but I don't see the format I have listed in &lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/leforinforref/n0av4h8lmnktm4n1i33et4wyz5yy.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/vdmmlcdc/1.0/leforinforref/n0av4h8lmnktm4n1i33et4wyz5yy.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dtm = input(dtc, datetime16.);
dt = datepart(dtm);
tm = timepart(dtm);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Mar 2022 19:55:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-date-into-date-format/m-p/805392#M317259</guid>
      <dc:creator>mariko5797</dc:creator>
      <dc:date>2022-03-31T19:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character date into date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-date-into-date-format/m-p/805397#M317263</link>
      <description>&lt;P&gt;That T means you need a quite different informat:&lt;/P&gt;
&lt;PRE&gt;data example;
  x='2018-04-19T06:16';
  dt = input(x,e8601dt.);
  format dt datetime.;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/leforinforref/p0jd9jaqmxd2ezn1kncmpgfqcpiz.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/vdmmlcdc/1.0/leforinforref/p0jd9jaqmxd2ezn1kncmpgfqcpiz.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the link you used is for FORMATS, to display values, not read them. Just needed to go down the page a bit further but experience is what lets some of us recognize when you need one of the E8601 or B8601 type informats.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 20:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-date-into-date-format/m-p/805397#M317263</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-31T20:52:43Z</dc:date>
    </item>
  </channel>
</rss>

