<?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: Difference between two time periods in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177550#M13619</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did subtract the two . However, I like to get the results in Days Hours using format statement or functions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 19:12:46 GMT</pubDate>
    <dc:creator>avatar</dc:creator>
    <dc:date>2014-05-29T19:12:46Z</dc:date>
    <item>
      <title>Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177547#M13616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to calculate difference between two time periods in days Hours, minutes ( how long it takes to complete the task)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example difference between 12MAY2014:08:20:19:00 and&amp;nbsp; 07MAY2014:08:00:45:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 18:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177547#M13616</guid>
      <dc:creator>avatar</dc:creator>
      <dc:date>2014-05-29T18:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177548#M13617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subtract the two records will give you the time in seconds. Then you can convert that to minutes/hours with some basic math (ie divide by 60). You can also try formatting using various time formats but because you cross days that might be an issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 19:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177548#M13617</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-05-29T19:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177549#M13618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take the difference between the two, the result is a number of seconds, then express in the required units:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;t1 = '12MAY2014:08:20:19.00'dt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;t2 = '07MAY2014:08:00:45.00'dt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dt = t1 - t2; /* time expressed in seconds */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dtStr = catx(":", put(dt/(24*60*60),6.0), put(mod(abs(dt),24*60*60),hhmm.));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;put dt= dtStr=;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: PG To get the sign right all the time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 19:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177549#M13618</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-05-29T19:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177550#M13619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did subtract the two . However, I like to get the results in Days Hours using format statement or functions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 19:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177550#M13619</guid>
      <dc:creator>avatar</dc:creator>
      <dc:date>2014-05-29T19:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177551#M13620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. I will give this a try&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 19:13:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177551#M13620</guid>
      <dc:creator>avatar</dc:creator>
      <dc:date>2014-05-29T19:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177552#M13621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would you like that to look? I don't believe there's a standard way to indicate days for duration in standard format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 19:14:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177552#M13621</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-05-29T19:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177553#M13622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The intck function does this for you.&amp;nbsp; You specify what interval&amp;nbsp; you want e.g. days, hours&lt;/P&gt;&lt;P&gt; &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67239/HTML/default/p1md4mx2crzfaqn14va8kt7qvfhr.htm#p1ombn8qbi8vkhn1w20ryode2ar5" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67239/HTML/default/p1md4mx2crzfaqn14va8kt7qvfhr.htm#p1ombn8qbi8vkhn1w20ryode2ar5"&gt;INTCK Function :: SAS(R) 9.4 Functions and CALL Routines: Reference, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the different intervals you can use:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/67227/HTML/default/p0g056g35ez8son1sfavozh0lfb3.htm#n1d3z2e1f8u8drn1j70702vf4q3h"&gt;http://support.sas.com/documentation/cdl/en/lrcon/67227/HTML/default/p0g056g35ez8son1sfavozh0lfb3.htm#n1d3z2e1f8u8drn1j70702vf4q3h&lt;/A&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67239/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67239/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/67239/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 22:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177553#M13622</guid>
      <dc:creator>tammy_dezilva</dc:creator>
      <dc:date>2014-05-29T22:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177554#M13623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;t1 = '12MAY2014:08:20:19.00'dt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;t2 = '07MAY2014:08:00:45.00'dt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;howlong = intck('second',t2,t1);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;days = datepart(howlong);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* basically taken from Professional SAS Programming Secrets, dating back to V6.03 and page 366-367&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;partday = timepart(howlong);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;put days 3. ':' partday time8.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 22:31:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177554#M13623</guid>
      <dc:creator>lloydc</dc:creator>
      <dc:date>2014-05-29T22:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177555#M13624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;data x;
t1 = '12MAY2014:08:20:19.00'dt;
t2 = '07MAY2014:08:00:45.00'dt;
days = int((t1-t2)/'24:00:00't);
time= mod((t1-t2),'24:00:00't); 
format time time8. t1 t2 datetime.;
run;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 14:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177555#M13624</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-05-30T14:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two time periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177556#M13625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&amp;nbsp; for sample code. I will give it&amp;nbsp; a try&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 14:52:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Difference-between-two-time-periods/m-p/177556#M13625</guid>
      <dc:creator>avatar</dc:creator>
      <dc:date>2014-05-30T14:52:35Z</dc:date>
    </item>
  </channel>
</rss>

