|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-03-18 20:56 UTC] aharvey@php.net
-Status: Open
+Status: Feedback
[2013-03-18 20:56 UTC] aharvey@php.net
[2013-03-18 20:59 UTC] xojins at gmail dot com
[2013-03-18 20:59 UTC] xojins at gmail dot com
-Status: Feedback
+Status: Open
[2013-03-18 21:03 UTC] aharvey@php.net
-Status: Open
+Status: Not a bug
[2013-03-18 21:03 UTC] aharvey@php.net
[2013-03-18 21:05 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 06:00:01 2025 UTC |
Description: ------------ When using the DATE function and returning the day of the week (lowercase L format) returns the wrong day of the week for 3/10/2013. The example provided shows subtracting 86400 seconds from strtotime('03/11/2013') to return 1362888000 seconds. When passed to DATE, it returns Saturday. This is wrong and should be Sunday. You need to add 3600 to any value to calculate 3/10/13 correctly. Test script: --------------- $d1 = date('l', strtotime('03/12/2013')-(60*60*24)); //date('l', 1363060800 - 86400) = date('l', 1362974400) = Monday $d2 =date('l', strtotime('03/11/2013')-(60*60*24)); //date('l', 1362974400 - 86400) = date('l', 1362888000) = Saturday != date('m-d-y', 1362888000) $d3 =date('l', strtotime('03/10/2013')-(60*60*24)); //date('l', 1362891600 - 86400) = date('l', 1362805200) = Saturday echo $d1 . '<br>'; echo $d2 . '<br>'; echo $d3 . '<br>'; Expected result: ---------------- Monday Sunday Saturday Actual result: -------------- Monday Saturday Saturday