The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

between the 24th and 31st are only the 25th, 26th, 27th, 28th, 29th, and 30th

six

LOL, you got me on that one...

What I should've said was between 00:00:00AM on the 24th March 2008 and 00:00:00AM on the 31st March 2008 there are 168 hours which breaks down to 7 days, but PHP is only recognising it as 6.95 days which throws my query into the ground

Next time it happend thou, I dug a little deeper. Has to do with daylight savings time, DST. Check out php.net/mktime for more info.

This sounds like the logical explanation as the BST +1hr comes in on the 25th March in 2008, so it might be that that's throwing a spanner into the works.

But, as the date of BST changing every year as it's always on a Saturday night rather than a specific date, I think I'm gonna have to go with jagat_21's code as that seems to work no matter what year/date you are looking at.

jagat_21's code is a solution I haven't seen before and a good one at that. As for the people that didn't know about the conversion functions jagat_21 used (like myself), we could use PEAR's Date and Date_Span.

Remember a caveat to using strtotime(), it is based on the UNIX epoch, 1/1/1970. Passing any dates before that as a parameter will give you a negative number of seconds which still works for calculations. Just don't try to pass the value back to date() or you'll always get 12/31/1969.