>From the manual: see the time functions at http://www.php.net/manual/en/ref.datetime.php specifically the gmmktime() function. Give it a date and it will tell u how many seconds have elapsed since after the Unix Epoch (1/1/1970 00:00). So gmmktime both the dates in question and you'll have two values in seconds. Subtract to get the number of seconds between them. Working out the days etc is just simple maths after that.
Asking for the number of months to be included is ambiguous, how long is a month?... :) R -----Original Message----- From: Byron Bignell [mailto:[EMAIL PROTECTED]] Sent: 13 January 2002 20:59 To: [EMAIL PROTECTED] Subject: [PHP-WIN] compare and get difference between two dates Ok. New as I am to PHP I need to ask this. How does one compare two dates and return the difference in years, months, days, hours, minutes and seconds? Byron \/ @@||=- -=|| bEe ||=- *----------------------------------* | >> The Virtual Village BBS | | >> Coming back soon. Stay tuned. | *----------------------------------* --> Nature hates to vacuum. <-- -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]