By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,278 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,278 IT Pros & Developers. It's quick & easy.

Date comparison function

P: n/a
Is there a Date module which I can use to compare Date Strings ?

e, g. if I have the following two date strings in different format:

Feb 9 15:00

2004/02/18 21:29:05

How do I convert them into a common format and then compare them to
see which date is more current ?

Thanks
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
we*********@yahoo.com (Ming Wei) wrote in message news:<e2**************************@posting.google. com>...
Is there a Date module which I can use to compare Date Strings ?

e, g. if I have the following two date strings in different format:

Feb 9 15:00

2004/02/18 21:29:05

How do I convert them into a common format and then compare them to
see which date is more current ?

Thanks

"perldoc -q date" should help. Here is a snip
if you don't know the precise format of your
dates, then you should probably use either of the
Date::Manip and Date::Calc modules from CPAN
before you go hacking up your own parsing routine
to handle arbitrary date formats.
Jul 19 '05 #2

P: n/a
Sunder Chakravaty wrote:
Ming Wei wrote:
Is there a Date module which I can use to compare Date Strings ?

e, g. if I have the following two date strings in different
format:

Feb 9 15:00

2004/02/18 21:29:05

How do I convert them into a common format and then compare them
to see which date is more current ?


"perldoc -q date" should help. Here is a snip
if you don't know the precise format of your
dates, then you should probably use either of the
Date::Manip and Date::Calc modules from CPAN
before you go hacking up your own parsing routine
to handle arbitrary date formats.


I wonder why it doesn't mention Date::Parse, which module appears to
be more on the spot.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.