in reply to Is there a better way to print time in a HH:MM:SS format than sprintf
I usually grab all the time-related variables and then format them according to my needs.
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime (ti +me); my $ts = sprintf("%02d:%02d:%2d" $hour, $min, $sec);
This way, they're available if I need some other form.
|
|---|