How to check that today's date is within a given range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a start_date and a finish_date stored in a mysql db.

I want to check that today's date falls between these 2 dates.

Can I set up the 3 dates so that a simple subtraction can be done? eg

if (($today - $start > 0) && ($finish - $today >0)) {
 ...within range...
} else {
 ...out of range...
}

I can't seem to find date functions that are of any use for this.

Thanks in advance.
 


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux