Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Date to be sorted in descending and time in ascending

by RichardK (Parson)
on May 18, 2012 at 09:38 UTC ( #971254=note: print w/replies, xml ) Need Help??


in reply to Date to be sorted in descending and time in ascending

Split out the bits of the datetime your interested in using substr.

my $dt = '20090405022100'; my $d = substr $dt,0,8; my $t = substr $dt,8;

Then read the perlfaq on sort How do I sort an array by (anything)?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971254]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2018-01-22 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (233 votes). Check out past polls.

    Notices?