<?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: datetime informat:  mm/dd/yyyy hh:mm:ss (24 hour time format) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/datetime-informat-mm-dd-yyyy-hh-mm-ss-24-hour-time-format/m-p/456993#M115831</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46197"&gt;@Ryanb2&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;It worked!&amp;nbsp; Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can import it using the informat you listed but the import transforms it to a new datetime format.&amp;nbsp; SAS doesn't recognize ANYDTDTM32 as a datetime format in the format statement. How do I keep it in the&amp;nbsp;mm/dd/yyyy hh:mm:ss (24 hour time format) format?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Formats and informats do not always have a corresponding one in the other half of the topic. If DATETIME19.&amp;nbsp;is unacceptable for your appearance then you can roll your own in Proc Format which allows some pretty exotic options for creating odd date or time appearances with a Picture statement.&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
picture dtmmddyy (default=19)
low-high = '%0m/%0d/%Y %0H:%0M:%0S' (datatype=datetime)
. = 'NA'
;
run;
data junk;
   x=dhms(today(),0,0,time());
   format x dtmmddyy.;
run;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 Apr 2018 18:02:01 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-04-24T18:02:01Z</dc:date>
    <item>
      <title>datetime informat:  mm/dd/yyyy hh:mm:ss (24 hour time format)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-informat-mm-dd-yyyy-hh-mm-ss-24-hour-time-format/m-p/456917#M115800</link>
      <description>&lt;P&gt;We have&amp;nbsp;a data file in csv format and there's a datetime field in&amp;nbsp;mm/dd/yyyy hh:mm:ss (24 hour time format) for which I'm having trouble importing.&amp;nbsp; Although this seems like a standard datetime format, surprisingly I can't seem to find an informat that works.&amp;nbsp; If the time was in the AM/PM format I could use&amp;nbsp;&lt;SPAN&gt;ANYDTDTM or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MDYAMPM** but the 24 hour time format appears to be problematic.&amp;nbsp; I'm writing specifications for data users and I'd like it to be as simple as possible (i.e., creating user-defined informat is not an option) and all other date formats are in the mm/dd/yyyy format and all times are in the hh:mm format (24 hour), so I'd like to keep to those standards if possible.&amp;nbsp; Is there an informat for this I just haven't found yet?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ryan&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 15:21:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-informat-mm-dd-yyyy-hh-mm-ss-24-hour-time-format/m-p/456917#M115800</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2018-04-24T15:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: datetime informat:  mm/dd/yyyy hh:mm:ss (24 hour time format)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-informat-mm-dd-yyyy-hh-mm-ss-24-hour-time-format/m-p/456937#M115804</link>
      <description>&lt;P&gt;Please show what you tried and the log if there are any warnings or errors. And perhaps a line or two of the data file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might try the ANYDTDTM as ANYDTDTM32. It seems that sometimes for whatever reason that using a longer version of the format works better than a shorter version&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 16:08:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-informat-mm-dd-yyyy-hh-mm-ss-24-hour-time-format/m-p/456937#M115804</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-24T16:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: datetime informat:  mm/dd/yyyy hh:mm:ss (24 hour time format)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-informat-mm-dd-yyyy-hh-mm-ss-24-hour-time-format/m-p/456944#M115806</link>
      <description>&lt;P&gt;It worked!&amp;nbsp; Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can import it using the informat you listed but the import transforms it to a new datetime format.&amp;nbsp; SAS doesn't recognize ANYDTDTM32 as a datetime format in the format statement. How do I keep it in the&amp;nbsp;mm/dd/yyyy hh:mm:ss (24 hour time format) format?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 16:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-informat-mm-dd-yyyy-hh-mm-ss-24-hour-time-format/m-p/456944#M115806</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2018-04-24T16:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: datetime informat:  mm/dd/yyyy hh:mm:ss (24 hour time format)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datetime-informat-mm-dd-yyyy-hh-mm-ss-24-hour-time-format/m-p/456993#M115831</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46197"&gt;@Ryanb2&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;It worked!&amp;nbsp; Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can import it using the informat you listed but the import transforms it to a new datetime format.&amp;nbsp; SAS doesn't recognize ANYDTDTM32 as a datetime format in the format statement. How do I keep it in the&amp;nbsp;mm/dd/yyyy hh:mm:ss (24 hour time format) format?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Formats and informats do not always have a corresponding one in the other half of the topic. If DATETIME19.&amp;nbsp;is unacceptable for your appearance then you can roll your own in Proc Format which allows some pretty exotic options for creating odd date or time appearances with a Picture statement.&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
picture dtmmddyy (default=19)
low-high = '%0m/%0d/%Y %0H:%0M:%0S' (datatype=datetime)
. = 'NA'
;
run;
data junk;
   x=dhms(today(),0,0,time());
   format x dtmmddyy.;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Apr 2018 18:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datetime-informat-mm-dd-yyyy-hh-mm-ss-24-hour-time-format/m-p/456993#M115831</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-24T18:02:01Z</dc:date>
    </item>
  </channel>
</rss>

