|
a slant on time ( ok, SAS time ! )
What is time 35:60 or 34:120 ?
=noon tomorrow !
Test it with a simple statement like this .....
%put %sysfunc( inputn( 34:120, time), datetime);
in the log 02JAN60:12:00:00
hour values greater than 23 and minute values greater than 60
are "equally respected" and carry over into the next hour or day!
Datum: 05.11.99 15:40
An: SAS-L@listserv.uga.edu
Antwort an: ABELSOR@westat.com
Betreff: Re: A Time check poll
Nachrichtentext:
Well, I stand corrected. However, the SAS function HMS does not (according to
TFM) accept an hour greater than 23. A test contradicts this, though.
1 data;
2 time24 = hms(24,0,0);
3 format time24 hhmm5.;
4 put time24=;
5 run;
TIME24=24:00
NOTE: The data set WORK.DATA1 has 1 observations and 1 variables.
NOTE: The DATA statement used 0.28 seconds.
So, I conclude that any solution to this problem will have to take 2400 as a
valid value.
Bob Abelson
Westat
____________________Reply Separator____________________
Subject: Re: A Time check poll
Author: "CUMMING; GORDON (PB)" <GC6872@MSG.PACBELL.COM>
Date: 11/04/1999 1:43 PM
I was brought up under the belief that time went as follows
23:59:59.99, 24:00:00.00, 00:00:00.01 and with rounding 23:59,
24:00, 00:00 depending on the resolution of your clock. Most
clock displays ignore the 24:00 as it comes by so fast and why
add extra work for a perfect clock. If you need it why not use
an analog timepiece. So for all purposes 23:59 < 24:00 < 00:00
in other words 24:00 does not equal 00:00 mathematically.
_gordon
> After talking with many of the people I work with about this, I thought
> I would come to the newgroup with many different views. Given a
> character variable (mytime) that is 4 chars long containing time values
> (hhmm) how would you check for valid clock time (24 hour clock). One
> obvious answer is to strip out the hours and minutes and check each for
> valid values (if 0 > hour > 24 or if 0 > mins > 59 then ERROR CONDITION)
> but I would like to take a pole on the different methods used. Some
> here have used methods that allow an hour of 25...and I never had an
> hour of 25 on my clock. Remember this is clock time not elapsed time.
>
> Regards,
> Vicki aka California Doll
> The great doing of little things makes the great life.
> - Eugenia Price
|