Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting dates

Status
Not open for further replies.
Apr 17, 2006
27
US
hi,

I have a list which contains dates in the format "10-Mar-2006 14:19:06 -0400" or "Fri, 10 Mar 2006 14:19:01 -0400".

How can this be sorted? I need to find the oldest date in this list and have it printed.

Thanks!
 
Convert the time to Epoch seconds.

Then sort the Epoch seconds for the smallest one.

Then convert it back and you have your oldest date.

 
mikedaruke - Thanks for your reply.

As you've probably guessed, I'm new to Perl. Is timelocal the best module to use here?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top