note 102034 rejected from function.strtotime by danbrown
| From: | danbrown@php.net | Date: | Mon, 24 Jan 2011 16:23:24 +0000 |
| Subject: | note 102034 rejected from function.strtotime by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176251@lists.php.net to get a copy of this message | ||
Note Submitter: pggrimes at hotmail dot com
----
I am using this code
if ($values["Cat1"])
$values["TargetTime"] = date("Y-m-d H:i:s",strtotime("+2 hour"));
if ($values["Cat2"])
$values["TargetTime"] = date("Y-m-d H:i:s",strtotime("+4 hour"));
if ($values["Cat3"])
$values["TargetTime"] = date("Y-m-d H:i:s",strtotime("+1 day"));
if ($values["Cat4"])
$values["TargetTime"] = date("Y-m-d H:i:s",strtotime("+2 day"));
if ($values["Cat5"])
$values["TargetTime"] = date("Y-m-d H:i:s",strtotime("+3 day"));
But were I am using +1 day, +2 day and +3 day, that is OK, My problems are +2 hour and +4 hour. As
our business hours are only 08:00 until 16:30, if I select a Cat2 at 16:00 it puts the TargetTime at
20:00 on the same day and not 11:30 the next day.
Any ideas on how I can make the strtotime only operate between 08:00 and 16:30?
Thanks
Paul