<?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: Time Difference Calculation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Time-Difference-Calculation/m-p/558234#M155781</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your values are stored as SAS Datetime values then you can simply subtract the the later from the earlier Datetime value. This gives you the difference in seconds. Then apply whatever time format suits you best for printing the result.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
  start_dttm='12MAY2019 23:15:00'dt;
  stop_dttm='13MAY2019 00:15:00'dt;
  diff=stop_dttm-start_dttm;
  format diff hhmm5.;
  output;
  stop;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2019 09:00:56 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-05-13T09:00:56Z</dc:date>
    <item>
      <title>Time Difference Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Difference-Calculation/m-p/558225#M155777</link>
      <description>I would like to get the answer as 1 hour or 60 minutes if I find the difference between following times. &lt;BR /&gt;&lt;BR /&gt;12MAY2019 11:15 pm&lt;BR /&gt;13MAY2019 12:15 am</description>
      <pubDate>Mon, 13 May 2019 08:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Difference-Calculation/m-p/558225#M155777</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-05-13T08:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Time Difference Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Difference-Calculation/m-p/558231#M155779</link>
      <description>&lt;P&gt;Use INTCK Function with the 'dtminute' or 'dthour' as the first argument.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 08:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Difference-Calculation/m-p/558231#M155779</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-13T08:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Time Difference Calculation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Difference-Calculation/m-p/558234#M155781</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your values are stored as SAS Datetime values then you can simply subtract the the later from the earlier Datetime value. This gives you the difference in seconds. Then apply whatever time format suits you best for printing the result.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
  start_dttm='12MAY2019 23:15:00'dt;
  stop_dttm='13MAY2019 00:15:00'dt;
  diff=stop_dttm-start_dttm;
  format diff hhmm5.;
  output;
  stop;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 09:00:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Difference-Calculation/m-p/558234#M155781</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-05-13T09:00:56Z</dc:date>
    </item>
  </channel>
</rss>

