Page 1 of 1

PHP date calculation

Posted: Fri Dec 10, 2004 12:38 am
by kahwooi
Hi all,

I am using php with firebird, I want to calculate the day different between 12/07/2005 and 05/20/2002. How to do it in php?

Thanks.

Posted: Fri Dec 10, 2004 12:39 pm
by AVATAr
In the online documentation: [php_man]date[/php_man] and read user comments

Posted: Fri Dec 10, 2004 12:49 pm
by pickle
If you want days, you could just convert both dates to timestamps, subtract the greater from the lesser, then convert the seconds back to days.