```Date: Wed, 12 Nov 2008 11:27:35 -0600 Reply-To: Sid N Sender: "SAS(r) Discussion" From: Sid N Subject: Re: Time interval Comments: To: "./ ADD NAME=Data _null_," In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Thank you for your replies. The 24-h times are in character format. I was able to determine the interval using the following code: T1 = input(substr(Time1,1,2)||":"||substr(Time1,3,2)||":",hhmmss.); T2 = input(substr(Time2,1,2)||":"||substr(Time2,3,2)||":",hhmmss.); Difference = intck('minutes', T1, T2); On Wed, Nov 12, 2008 at 11:13 AM, ./ ADD NAME=Data _null_, < iebupdte@gmail.com> wrote: > On 11/12/08, Allen Ziegenfus wrote: > > Couldn't you just subtract the two and divide by 60 or am I missing the > > point here? > > Yes because the units are not seconds for example 1337 is not in > seconds units it is 49020 seconds. > > 210 data _null_; > 211 a=1224; > 212 b=1337; > 213 c = b - a; > 214 aT = input(put(a/1e2,5.2),time.); > 215 bT = input(put(b/1e2,5.2),time.); > 216 dT = bT - aT; > 217 dM = dT / 60; > 218 put 'NOTE: Results' @; > 219 put (_all_)(/= 'NOTE- '); > 220 > 221 *format aT bT time. dt mmss.; > 222 run; > > NOTE: Results > a=1224 > b=1337 > c=113 *** this is not 73 as it should be; > aT=44640 > bT=49020 > dT=4380 > dM=73 > > > > > > -----Ursprüngliche Nachricht----- > > Von: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Im Auftrag von > Sid N > > Gesendet: Mittwoch, 12. November 2008 17:37 > > An: SAS-L@LISTSERV.UGA.EDU > > Betreff: Time interval > > > > I am trying to find the difference (in minutes) between two times which > are > > in the format hhmm (24-hr format). For example, the difference between > 1224 > > and 1337 should result in 73 minutes. > > > > Is there a function in SAS that can be used directly? > > > > Thank you for your attention. > > > > Sid > > > ```

Back to: Top of message | Previous page | Main SAS-L page