marauder has asked for the wisdom of the Perl Monks concerning the following question:
$current_time="00:02:25"; @stime = split(/:/, $current_time); $current_time_more10s = 3600*$stime[0] + 60*$stime[1] + $stime[2]; $current_time_more10s=$current_time_more10s+10; $hours=($current_time_more10s/(60*60))%24;if($hours<10){$hours="0$hour +s";} $mins=($current_time_more10s/60)%60;if($mins<10){$mins="0$mins";} $secs=$current_time_more10s%60;if($secs<10){$secs="0$secs";} $newtime="$hours:$mins:$secs"; print $newtime;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: increment hh:mm:ss
by belg4mit (Prior) on Jan 26, 2002 at 23:55 UTC | |
|
Re: increment hh:mm:ss
by jonjacobmoon (Pilgrim) on Jan 27, 2002 at 00:52 UTC | |
|
Re: increment hh:mm:ss
by dws (Chancellor) on Jan 27, 2002 at 00:16 UTC | |
|
Re: increment hh:mm:ss
by nandeya (Monk) on Jan 27, 2002 at 06:14 UTC | |
|
Re: increment hh:mm:ss
by Aristotle (Chancellor) on Jan 26, 2002 at 23:27 UTC | |
|
Using Time::Piece to increment hh:mm:ss
by blakem (Monsignor) on Jan 27, 2002 at 07:31 UTC | |
|
Re: increment hh:mm:ss
by theguvnor (Chaplain) on Jan 27, 2002 at 00:11 UTC | |
|
Re: increment hh:mm:ss
by gav^ (Curate) on Jan 26, 2002 at 23:32 UTC |