<?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 custom informat datetime to DATETIMEn. format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-custom-informat-datetime-to-DATETIMEn-format/m-p/408990#M99890</link>
    <description>&lt;P&gt;Your date is weird enough that you must parse the string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is&amp;nbsp;one way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  A='Tue Oct 31 01:30:31 2017';
  B=input(scan(A,3)||scan(A,2)||scan(A,5,' ')||':'||scan(A,4,' '),datetime.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2017 05:40:11 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2017-10-31T05:40:11Z</dc:date>
    <item>
      <title>Converting custom informat datetime to DATETIMEn. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-custom-informat-datetime-to-DATETIMEn-format/m-p/408966#M99885</link>
      <description>&lt;P&gt;I've been searching function or a way to convert datetime &lt;FONT color="#0000FF"&gt;DDD MON DD HH:MM:SS YYYY&lt;/FONT&gt; (e.g&amp;nbsp;&lt;STRONG&gt;Tue Oct 31 01:30:31 2017)&lt;/STRONG&gt; I received from datalist to DATETIME19. At the moment I use &lt;STRONG&gt;SQL CASE&lt;/STRONG&gt; format, &lt;STRONG&gt;FIND&amp;nbsp;&lt;/STRONG&gt;function&amp;nbsp;and temporary field to get day, month, year, hour, minute and&amp;nbsp;second.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using SAS 9.2&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 03:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-custom-informat-datetime-to-DATETIMEn-format/m-p/408966#M99885</guid>
      <dc:creator>Ani_Abby</dc:creator>
      <dc:date>2017-10-31T03:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Converting custom informat datetime to DATETIMEn. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-custom-informat-datetime-to-DATETIMEn-format/m-p/408990#M99890</link>
      <description>&lt;P&gt;Your date is weird enough that you must parse the string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is&amp;nbsp;one way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  A='Tue Oct 31 01:30:31 2017';
  B=input(scan(A,3)||scan(A,2)||scan(A,5,' ')||':'||scan(A,4,' '),datetime.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 05:40:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-custom-informat-datetime-to-DATETIMEn-format/m-p/408990#M99890</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-10-31T05:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Converting custom informat datetime to DATETIMEn. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-custom-informat-datetime-to-DATETIMEn-format/m-p/408992#M99892</link>
      <description>&lt;P&gt;If the variable is a datetime number (the number of seconds from midnight 1 January 1960), then you can apply any of a range of datetime formats to display the data as you wish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the variable is not a datetime number, then you have to extract the components and re-assemble them. If you do this correctly, you can convert the result into a SAS datetime number, then apply a format as described above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some advice on coding can be found here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2011/11/15/do-you-mind-if-we-dance-with-your-dates/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2011/11/15/do-you-mind-if-we-dance-with-your-dates/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 05:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-custom-informat-datetime-to-DATETIMEn-format/m-p/408992#M99892</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2017-10-31T05:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Converting custom informat datetime to DATETIMEn. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-custom-informat-datetime-to-DATETIMEn-format/m-p/409000#M99898</link>
      <description>Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 31 Oct 2017 06:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-custom-informat-datetime-to-DATETIMEn-format/m-p/409000#M99898</guid>
      <dc:creator>Ani_Abby</dc:creator>
      <dc:date>2017-10-31T06:23:09Z</dc:date>
    </item>
  </channel>
</rss>

