mt2k has asked for the wisdom of the Perl Monks concerning the following question:
How would I go about sorting times, that include the hour, minutes, and AM/PM, into a well-sorted list??
Here is what the times I need to sort would look like:
3:15PM 1:00AM 8:30AM 6:15PM 2:45PM
1:00AM 8:30AM 2:45PM 3:15PM 6:15PM
So basically, how would I go sorting these? I can't use a simple sort { $a cmp $b}, because then it sorts to:
1:00AM 2:45PM 3:15AM 6:15AM 8:30AM
Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting Times
by clintp (Curate) on Apr 28, 2001 at 05:21 UTC | |
|
Re: Sorting Times
by boo_radley (Parson) on Apr 28, 2001 at 05:02 UTC | |
|
Re: Sorting Times
by Rhandom (Curate) on Apr 28, 2001 at 06:30 UTC | |
|
(tye)Re: Sorting Times
by tye (Sage) on Apr 28, 2001 at 10:17 UTC | |
|
Re: Sorting Times
by Trimbach (Curate) on Apr 28, 2001 at 07:49 UTC | |
by Rhandom (Curate) on Apr 28, 2001 at 12:10 UTC | |
by Dominus (Parson) on Apr 29, 2001 at 22:49 UTC | |
|
Re: Sorting Times
by japhy (Canon) on Apr 29, 2001 at 01:09 UTC | |
|
Re: Sorting Times
by mt2k (Hermit) on Apr 28, 2001 at 23:26 UTC |