<?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: SAS Time Format to Seconds in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476342#M122575</link>
    <description>&lt;P&gt;SAS stores times as seconds natively. A format is used to control the display, so removing the format will create the raw seconds value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data demo;
x='11:45't;
y=x;

format x time6.;
format y; *no format, not needed but how you would remove a format;

run;


proc print data=demo;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Jul 2018 01:09:10 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-07-09T01:09:10Z</dc:date>
    <item>
      <title>SAS Time Format to Seconds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476332#M122570</link>
      <description>&lt;P&gt;I have looked all over the place for this and haven't been able to find anything to lead me in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset that is in SAS Time format HH:MM:SS (24 hours time format)... what i need to do is convert the time to seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for example, 0:12:28 would be converted to 748.&amp;nbsp; I know its possible.. i just can't find a way to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help with a datastep or a calculated field in a select statement that can do this.&amp;nbsp; The name of the field is TTL_AHT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be awesome!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DZ&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jul 2018 23:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476332#M122570</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2018-07-08T23:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Time Format to Seconds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476334#M122572</link>
      <description>&lt;P&gt;Run and have fun--&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
k='0:12:28't;
k1='0:12:28';
k2=input(k1,time.);/* i think you want this*/
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 08 Jul 2018 23:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476334#M122572</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-08T23:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Time Format to Seconds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476337#M122573</link>
      <description>&lt;P&gt;If you have a TIME variable it is already in seconds.&amp;nbsp; Just remove the format if you want it to print as a raw number of seconds instead of being formatted to look like a time value.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 00:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476337#M122573</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-09T00:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Time Format to Seconds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476342#M122575</link>
      <description>&lt;P&gt;SAS stores times as seconds natively. A format is used to control the display, so removing the format will create the raw seconds value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data demo;
x='11:45't;
y=x;

format x time6.;
format y; *no format, not needed but how you would remove a format;

run;


proc print data=demo;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Jul 2018 01:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476342#M122575</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-09T01:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Time Format to Seconds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476365#M122594</link>
      <description>&lt;P&gt;Thanks Tom!&amp;nbsp; After I read... i realized that i was trying to complicate it way too much... i knew that deep down inside.&amp;nbsp; Thank you so much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DZ&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 06:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Time-Format-to-Seconds/m-p/476365#M122594</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2018-07-09T06:39:02Z</dc:date>
    </item>
  </channel>
</rss>

