Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Hash sorting with dates and 12 hour time format.by shift9999 (Acolyte) |
on Sep 15, 2009 at 20:57 UTC ( [id://795476]=perlquestion: print w/replies, xml ) | Need Help?? |
shift9999 has asked for the wisdom of the Perl Monks concerning the following question: I have been reviewing the perlfaq on using the sort function correctly but so far have not been able to get the exact output I need. I have a hash setup with the dates and times as the keys and the data as the value. I need to sort the dates and times properly. this would normally not be a big issue but the times are in 12 hour format. here is the format of the hash:Here is the sort: This will sort the dates and times but seems to ignore the AM/PM. The code above does not reflect it but I have tried expanding on the sort with a custom sub called from it. I have not been sucessfull in setting up the right comparison code. More information to follow as I tinker with the sort helper sub. Any help would be appreciated.
Back to
Seekers of Perl Wisdom
|
|