<?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 Formatting 24 hr character time to 24hr numeric time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Formatting-24-hr-character-time-to-24hr-numeric-time/m-p/687048#M208553</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; My time of arrivals were in excel as '17:07' and there must have previously been some character code in the column, because when I imported to SAS it changed to&amp;nbsp;$21. and looks like '.7139444444444' except it's now in character. Any ideas how to change it back to the original numeric 24-hr time?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;arrival time&lt;/P&gt;&lt;P&gt;.73194444444&lt;/P&gt;&lt;P&gt;.14652777778&lt;/P&gt;&lt;P&gt;.34444444444&lt;/P&gt;&lt;P&gt;.3&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;arrival time&lt;/P&gt;&lt;P&gt;17:07&lt;/P&gt;&lt;P&gt;3:31&lt;/P&gt;&lt;P&gt;8:16&lt;/P&gt;&lt;P&gt;7:12&lt;/P&gt;</description>
    <pubDate>Sun, 27 Sep 2020 17:11:03 GMT</pubDate>
    <dc:creator>stancemcgraw</dc:creator>
    <dc:date>2020-09-27T17:11:03Z</dc:date>
    <item>
      <title>Formatting 24 hr character time to 24hr numeric time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-24-hr-character-time-to-24hr-numeric-time/m-p/687048#M208553</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; My time of arrivals were in excel as '17:07' and there must have previously been some character code in the column, because when I imported to SAS it changed to&amp;nbsp;$21. and looks like '.7139444444444' except it's now in character. Any ideas how to change it back to the original numeric 24-hr time?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;arrival time&lt;/P&gt;&lt;P&gt;.73194444444&lt;/P&gt;&lt;P&gt;.14652777778&lt;/P&gt;&lt;P&gt;.34444444444&lt;/P&gt;&lt;P&gt;.3&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;arrival time&lt;/P&gt;&lt;P&gt;17:07&lt;/P&gt;&lt;P&gt;3:31&lt;/P&gt;&lt;P&gt;8:16&lt;/P&gt;&lt;P&gt;7:12&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2020 17:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-24-hr-character-time-to-24hr-numeric-time/m-p/687048#M208553</guid>
      <dc:creator>stancemcgraw</dc:creator>
      <dc:date>2020-09-27T17:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting 24 hr character time to 24hr numeric time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatting-24-hr-character-time-to-24hr-numeric-time/m-p/687049#M208554</link>
      <description>&lt;P&gt;Excel stores time as fraction of a day. So just multiple by 24 hours.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input arrival $20.;
cards;
.73194444444
.14652777778
.34444444444
.3
;

data want;
  set have;
  time = '24:00't * input(arrival,32.);
  format time tod5.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;PRE&gt;Obs    arrival          time

 1     .73194444444    17:34
 2     .14652777778    03:31
 3     .34444444444    08:16
 4     .3              07:12
&lt;/PRE&gt;</description>
      <pubDate>Sun, 27 Sep 2020 17:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatting-24-hr-character-time-to-24hr-numeric-time/m-p/687049#M208554</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-27T17:18:04Z</dc:date>
    </item>
  </channel>
</rss>

