<?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 time to 24 hr format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388319#M65916</link>
    <description>Hi Shmuel.&lt;BR /&gt;Thanks for response...how do I apply it I'm using a&lt;BR /&gt;Data table1;&lt;BR /&gt;Set table1;&lt;BR /&gt;Time =timepart (open _date);&lt;BR /&gt;Format time datetime.;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;It gives 01jan1960 05:49:53 the time is still at general time</description>
    <pubDate>Tue, 15 Aug 2017 21:18:10 GMT</pubDate>
    <dc:creator>Gil_</dc:creator>
    <dc:date>2017-08-15T21:18:10Z</dc:date>
    <item>
      <title>How to convert time to 24 hr format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388188#M65912</link>
      <description>Hi I have a datetime field open date&lt;BR /&gt;08/01/2017 1;42;00 PM&lt;BR /&gt;I need to convert the date to&lt;BR /&gt;08/01/2017 13:42 PM&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 15 Aug 2017 15:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388188#M65912</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-08-15T15:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert time to 24 hr format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388200#M65913</link>
      <description>&lt;P&gt;Change format from &lt;STRONG&gt;DATEAMPMw&lt;/STRONG&gt;. &amp;nbsp;to &lt;STRONG&gt;DATETIMEw&lt;/STRONG&gt;. where w is length of output dislaying date and time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If time is 13:42 there is no need to add PM.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 15:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388200#M65913</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-08-15T15:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert time to 24 hr format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388319#M65916</link>
      <description>Hi Shmuel.&lt;BR /&gt;Thanks for response...how do I apply it I'm using a&lt;BR /&gt;Data table1;&lt;BR /&gt;Set table1;&lt;BR /&gt;Time =timepart (open _date);&lt;BR /&gt;Format time datetime.;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;It gives 01jan1960 05:49:53 the time is still at general time</description>
      <pubDate>Tue, 15 Aug 2017 21:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388319#M65916</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-08-15T21:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert time to 24 hr format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388339#M65918</link>
      <description>&lt;P&gt;When you use function TIMEPART you have time only, without the date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format DATETIME is to be used with your variable Open_Date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use format time5. or time7. for TIME (as timepart).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data table1;
Set table1;
Time =timepart (open _date);
Format open_date datetime. 
            time    time7.;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Look at next link - formats by categories:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001263753.htm" target="_self"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001263753.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 22:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388339#M65918</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-08-15T22:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert time to 24 hr format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388522#M65928</link>
      <description>Thanks for the example it did 2 things it convert all my dates to 01jan6005:49:53. So the column of time it does give me the right format but the time is 5:49:53 should be 04:49:53 .. I'm using your data set .. thanks</description>
      <pubDate>Wed, 16 Aug 2017 16:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388522#M65928</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-08-16T16:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert time to 24 hr format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388549#M65929</link>
      <description>&lt;P&gt;You compute&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Time =timepart (open_date);&lt;/PRE&gt;
&lt;P&gt;which gives you a date of&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;01jan60 -&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;this turns a red light, maybe your variable Open_Date is not a datetime but a time only.&lt;/P&gt;
&lt;P&gt;In sas 0 (zero) is equal to Jan 1st 1960.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data _NULL_;
set have;
 put open_date  time9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and check the log.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 17:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-convert-time-to-24-hr-format/m-p/388549#M65929</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-08-16T17:52:16Z</dc:date>
    </item>
  </channel>
</rss>

