"John Meyer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
> Is there a function to determine the difference between two dates?  I am
> asking so I can do some date verification for COPA.

Convert your dates to timestamps which will be 10-digit integers (the time
since 1.1.1970 in seconds) you can then substract/add them like normal
numbers.

$date = '2004-07-15 01:00:00';
$date2 = '2004-07-15 02:00:00';
$timestamp = strtotime($date);
$timestamp2 = strtotime($date2);

echo $timestamp2 - $timestamp1; // will output 3600 (seconds)

Hope this helps. Regards,

Torsten Roehr

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to