Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to get minimum start date in these start dates ?

by explorer (Chaplain)
on Jul 10, 2006 at 09:29 UTC ( [id://560103]=note: print w/replies, xml ) Need Help??


in reply to How to get minimum start date in these start dates ?

And after the homework, try this:
use DateTime; use DateTime::Format::Strptime; my @start_date = qw(01-06-2007 01-08-2006 01-06-2006 01-07-2007 06-01- +2007); my $Strptime = new DateTime::Format::Strptime( pattern => '%d-%m-%Y' ) +; my @start_datetimes; foreach my $datetime ( @start_date ) { push @start_datetimes, $Strptime->parse_datetime( $datetime ); print $start_datetimes[-1]->ymd('-'); } print "-"x10; my @sort_datetimes = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, $_->epoch ] } @start_datetimes; print $_->ymd('-') foreach @sort_datetimes; __OUTPUT__ 2007-06-01 2006-08-01 2006-06-01 2007-07-01 2007-01-06 ---------- 2006-06-01 2006-08-01 2007-01-06 2007-06-01 2007-07-01
Note: Teachers don't likes modules :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://560103]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-24 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found