Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by explorer (Chaplain)
on Jul 10, 2006 at 09:29 UTC ( #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 :-)


Comment on Re: How to get minimum start date in these start dates ?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2014-09-19 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls