View Single Post
  #7 (permalink)  
Old March 15th, 2007, 05:43 AM
ciderpunx ciderpunx is offline
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Sorry mate, me being dozy. Sounds like what you're actually after is $date1-$date2=$difference_in_days.

You /could/ write something to do this but it'd be a big gnarly thing to write, normally I'd just say use CPAN, but it sounds like you can't. If the dates are in a database you may find that you can do the date maths there and save yourself some faff. Otherwise, take a look at the source of Date::Calc and see how they did it!

Good luck

--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk