note 102034 added to function.strtotime

From: Date: Mon, 24 Jan 2011 16:21:49 +0000
Subject: note 102034 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-176250@lists.php.net to get a copy of this message
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 ---- Server IP: 69.147.83.197 Probable Submitter: 82.42.244.38 ---- Manual Page -- http://www.php.net/manual/en/function.strtotime.php Edit -- https://master.php.net/note/edit/102034 Del: integrated -- https://master.php.net/note/delete/102034/integrated Del: useless -- https://master.php.net/note/delete/102034/useless Del: bad code -- https://master.php.net/note/delete/102034/bad+code Del: spam -- https://master.php.net/note/delete/102034/spam Del: non-english -- https://master.php.net/note/delete/102034/non-english Del: in docs -- https://master.php.net/note/delete/102034/in+docs Del: other reasons-- https://master.php.net/note/delete/102034 Reject -- https://master.php.net/note/reject/102034 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#176250) next »