|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-01-04 18:34 UTC] tripollite at gmail dot com
Description:
------------
date('d/m/Y',strtotime('last day of this year', mktime(1,1,1,1,1,2011)));
expected : 31/12/2011
get : 31/01/2011
Test script:
---------------
echo date('d/m/Y',strtotime('last day of this year', mktime(1,1,1,1,1,2011)));
Expected result:
----------------
31/12/2011
Actual result:
--------------
31/01/2011
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 03:00:01 2025 UTC |
Works for me, could you run the following script please: <?php echo date_default_timezone_get(), "\n"; $ts = mktime(1,1,1,1,1,2011); echo $ts, ': ', date('Y-m-d H:i:s e', $ts), "\n"; $newTs = strtotime('last day of this year', $ts ); echo $newTs, ': ', date('Y-m-d H:i:s e', $newTs), "\n"; ?>Just hit the same snatch. Had to go with date('last day of December '.date('Y')) Will love to have this in the feature.