Note: Teachers don't likes modules :-)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
In reply to Re: How to get minimum start date in these start dates ?
by explorer
in thread How to get minimum start date in these start dates ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |