|
|
Is there a format to print time values with leading zeros?
Hi,
SAS 9.1.3 SP 4, Windows XP
Is there a format to print time values (HH:MM, no seconds needed) in
24 hour format, i.e. with a leading zero?
A check of the doc indicates "no", but just wanted to confirm. I just
want standard 24 hour time output, like 04:53 and 18:12. 24 hour time
output always uses a leading zero for hour < 10. I'm surprised SAS
doesn't have a format to do this.
This is the best I could come up with - better approaches most
welcome.
data _null_;
time="09:59:59"t; * "play" with this value, both < and > 10:00 ;
timec=ifc(hour(time) <
10,cats("0",put(time,time5.)),put(time,time5.));
put time =time5. timec=;
run;
Thanks,
Scott
|
|
0
|
|
|
|
Reply
|
Scott
|
3/30/2010 9:03:33 AM |
|
Hi Scott
Hope you're well.
Seems you forgot about picture formats.
Cheers
Patrick
proc format;
picture _zhhmm
other='%0H:%0M'
(datatype=time);
run;
data _null_;
time='5:12't;
put time= _zhhmm.;
run;
|
|
0
|
|
|
|
Reply
|
Patrick
|
3/30/2010 10:06:05 AM
|
|
|
1 Replies
551 Views
(page loaded in 0.484 seconds)
Similiar Articles: Is there a format to print time values with leading zeros? - comp ...Hi, SAS 9.1.3 SP 4, Windows XP Is there a format to print time values (HH:MM, no seconds needed) in 24 hour format, i.e. with a leading zero? ... Leading Zeros - comp.soft-sys.sasIs there a format to print time values with leading zeros? - comp ... Hi, SAS 9.1.3 SP 4, Windows XP Is there a format to print time values (HH:MM, no seconds needed) in ... Numbers formatted with leading zeros? - comp.databases.filemaker ...Is there a format to print time values with leading zeros? - comp ... How to Add Leading Zeros in Excel | eHow.com Microsoft Excel's general number format drops leading ... count leading zero - comp.lang.asm.x86Is there a format to print time values with leading zeros? - comp ... printf - C++ Reference - cplusplus.com - The C++ Resources Network... number, the result is padded ... date time concatenation - comp.soft-sys.sasIs there a format to print time values with leading zeros? - comp ..... prevent values less than zero from displaying ... doesn't come with the Date and Time ... padded zeros in columns - comp.soft-sys.matlabIs there a format to print time values with leading zeros? - comp ... Simple example for fomatting output in columns? - comp.lang.java ... There's ... cplusplus.com - The ... Creating a unique alpha number serial ID - comp.databases ...Is there a format to print time values with leading zeros? - comp ... Creating a unique alpha number serial ID - comp.databases ... Is there a format to print time values ... 1.2 Mb floppy - comp.lang.asm.x86Is there a format to print time values with leading zeros? - comp ... 1.2 Mb floppy - comp.lang.asm.x86 i have a very old dos program that let you format and ... Where is Java's cache stored in WinXP? - comp.lang.java.programmer ...- Every time you connect to a web site, you get a message about"Upgrading Java applet ... use it as a key in> a HashMap type of cache ... collection> of values, and any object ... convert integer to string - comp.lang.perl.misc4 ) ; %y = (x => \@x); print Dumper ... to a string to >preserve the leading zeros. There ... I'd like to convert (the value of) a variable inside a tempo template from a ... Is there a format to print time values with leading zeros? - comp ...Hi, SAS 9.1.3 SP 4, Windows XP Is there a format to print time values (HH:MM, no seconds needed) in 24 hour format, i.e. with a leading zero? ... Concatenation with leading zeros - ExcelBanterConcatenation with leading zeros Excel ... to concatenate and keep the leading zeroes? Or is there a ... Format a cell to keep leading zeros. Shadyhosta: New Users to Excel 7/24/2012 1:18:54 AM
|
|
|
|
|
|
|
|
|