Dru has asked for the wisdom of the Perl Monks concerning the following question:
02:29:40Falls between a start and stop time in the same format? I came up with this elementray way of converting the hours, minutes, and seconds into a number like so:
But I'm thinking there has got to be an easier/cleaner way. I looked through the plethora of Date/Time modules on CPAN and nothing is jumping out at me (but I'm sure it's right in front of me).my ($ace_hour_start,$ace_min_start,$ace_sec_start) = (split/:/, $ace_start_time); $ace_hour_start = $ace_hour_start * 100; $ace_min_start = $ace_min_start * 10; $ace_start_time = $ace_hour_start + $ace_min_start + $ace_sec_start +; my ($ace_hour_stop,$ace_min_stop,$ace_sec_stop) = (split/:/, $ace_stop_time); $ace_hour_stop = $ace_hour_stop * 100; $ace_min_stop = $ace_min_stop * 10; $ace_stop_time = $ace_hour_stop + $ace_min_stop + $ace_sec_stop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Seeing if a Time is Within a Range
by blokhead (Monsignor) on Oct 26, 2004 at 18:33 UTC | |
|
Re: Seeing if a Time is Within a Range
by pg (Canon) on Oct 26, 2004 at 18:34 UTC | |
by Anonymous Monk on Oct 26, 2004 at 20:19 UTC | |
by pg (Canon) on Oct 26, 2004 at 21:21 UTC | |
|
Re: Seeing if a Time is Within a Range
by fglock (Vicar) on Oct 26, 2004 at 18:30 UTC | |
|
Re: Seeing if a Time is Within a Range
by LTjake (Prior) on Oct 27, 2004 at 15:32 UTC |