RE: [PHP] Working with dates
| From: | John W. Holmes | Date: | Mon, 17 Mar 2003 17:48:45 +0000 |
| Subject: | RE: [PHP] Working with dates | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139991@lists.php.net to get a copy of this message | ||
> I have two variables, $StartDate and &EndDate that contain values read
> from MySQL Date fields. How can I determine if a value entered by the
> user is between the two dates? I'm using PHP 4.0.6.
I think you can take MySQL timestamps directly into strtotime().
If($user > strtotime($StartDate) && $user < strtotime($EndDate))
{ do something; }
Many ways to do it...
---John Holmes...