in reply to Finding the difference between 2 dates in seconds

Your example case is a relatively simple one in that the two dates in question are within the same month.

If you wanted this to be absolutely correct for ANY two dates, there are plenty of complications to consider: not least of them being leap years and worldwide time zones.

I recently had to solve a similar problem and looked into various modules out there, and concluded that DateTime was the best one to use. May be worth you taking a look.

  • Comment on Re: Finding the difference between 2 dates in seconds