Hi,
well, sorry to tell you that there's some bugs 🙂
for instance :
if you have :
$date1 = "31/10/2002 12:00";
$date2 = "02/11/2002 13:30";
then :
days = $date2_exp1[0] - $date1_exp1[0];
#Outputs the difference.
echo "Days Difference : $days<br>";
will output :
Days Differents : 29
the same goes for months
You should look for function like mktime() and to use
timestamp to compare two dates ; it's much more simple/sure
to code that way.
more info here :
http://www.php.net/manual/en/function.mktime.php
also :
$time1_hrs_mins = $time1_exp1[0]60;
$time1_mins_secs = $time1_hrs_mins + $time1_exp1[1];
$time1_all_secs = $time1_mins_secs60;
it's a bit strange,
if in $date2 = "02/11/2002 13:30"; 13:30 is the time, in which 13 is the hours and 30 the minutes ?
if I want to convert that in number of seconds I should do :
$time1_all_secs = ($time1_exp[0]60) + ($time_1_exp[1]3600);
Don't despair, you can't succeed if you don't try 😉 !
Regards,
Hervé.