help needed with php project
need to work out day difference in dates
Regards,
Damian
www.phpexpert.org
any UK programmers can ring me on
FREEphone 0800 019 0924
The difference between one day and another is 86400. (In PHP it is).
So if we wanted to find out the difference between date1 and date2 we can do
following:
$date_diff_in_days = ($date1 - date2) / 86400;
This is how I tested it:
$date1 = strtotime("5 January 1990");
$date2 = strtotime("5 January 1991");
$date_diff_in_days = ($date2 - $date1) / 86400;
print "There are ".$date_diff_in_days;
As easy as.
Hope that helps. Let me know how you go.
Werner Sandner
http://www.supremweb.com
man...@supremweb.com
Cairns, North Eastern Australia
"Damian Brown" <dam...@bleachboys.com> wrote in message
news:bg948b$71h$1...@hercules.btinternet.com...