PHP way:

Use strtotime() to get a unix timestamp for each one. subtract smaller from
larger and divide by number of seconds in a day.

MySQL way:

I assume these dates come from a database. Use a query like this:

SELECT TO_DAYS(column_one) - TO_DAYS(column_two) AS Difference FROM table
WHERE ...

Then you'll have a column 'Difference' in your result that contains the
difference between the two dates in days.

---John Holmes...

----- Original Message -----
From: "Jeroen Timmers" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 28, 2002 2:16 PM
Subject: [PHP] Dates


> i have two dates
>
> for example
>
> 2002-10-9 and 2002-11-16
>
> Is there a function to see how many day's between thore date's is?
>
> Jeroen
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to