#23211 [Bgs->Opn]: April First Week strtotime day off error
| From: | jmalan at ocurrance dot com | Date: | Tue, 22 Apr 2003 15:10:19 +0000 |
| Subject: | #23211 [Bgs->Opn]: April First Week strtotime day off error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38067@lists.php.net to get a copy of this message | ||
ID: 23211
User updated by: jmalan at ocurrance dot com
Reported By: jmalan at ocurrance dot com
-Status: Bogus
+Status: Open
Bug Type: Calendar related
Operating System: Linux 7
PHP Version: 4.3.1
New Comment:
Maybe that should be stated in the documentation in the strtotime area
so developers know to add that. What would the syntax be if you were
doing last saturday?
Previous Comments:
------------------------------------------------------------------------
[2003-04-22 01:30:26] rasmus@php.net
If you specify the timezone at the end of your strtotime string it
should work just fine.
------------------------------------------------------------------------
[2003-04-14 16:24:36] jmalan at ocurrance dot com
Found a better fix. Instead of using strtotime("last saturday"), try
this:
date("m/d/Y H:i:s",strtotime("-1 week saturday"));
The timechange didn't seem to have any affect to strtotime this way.
------------------------------------------------------------------------
[2003-04-14 15:54:18] mbarrus at elixirlabs dot com
We were having a similar issue. stringtotime does not seem to take in
considuration Daylight Savings.
------------------------------------------------------------------------
[2003-04-14 15:44:19] jmalan at ocurrance dot com
I have designed a scheduler for a call center which uses the work week
of saturday through friday. If you use strtotime("last saturday") in
the first week of april after the first saturday of april your
strtotime will be off by one day. This happens in any year only during
this time frame. To test it make sure you change your dates on your
testing server. Quick Fix is $lastThursday = strtotime("last friday").
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23211&edit=1