|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-05-31 09:47 UTC] phil at goli dot at
// current date is 31.05.2001 GMT
// this should return '03' (5-2=3) -> OK
echo gmdate( "m", mktime(date("H"), date("i"), date("s"), date("m")-2, date("d"), date("Y")) ).'<br>';
// this should return '02' (5-3=2) -> but returns '03' !!!!
echo gmdate( "m", mktime(date("H"), date("i"), date("s"), date("m")-3, date("d"), date("Y")) ).'<br>';
// comment: yesterday it worked (on the 30.05.2001 GMT)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 16:00:01 2025 UTC |
// Sorry - it's not a bug actually I think - it's just, that // date("d") returns '31' in may - therefore the calculation // does not work this way - if you use ... date("m")-2, 1, date("Y") ... it works! // current date is 31.05.2001 GMT // this should return '03' (5-2=3) -> OK echo gmdate( "m", mktime(date("H"), date("i"), date("s"), date("m")-2, date("d"), date("Y")) ).'<br>'; // this should return '02' (5-3=2) -> but returns '03' !!!! echo gmdate( "m", mktime(date("H"), date("i"), date("s"), date("m")-3, date("d"), date("Y")) ).'<br>'; // comment: yesterday it worked (on the 30.05.2001 GMT)