Bug #53650 [Asn]: Fail on strtotime('last day of this year')

From: Date: Tue, 04 Jan 2011 18:44:30 +0000
Subject: Bug #53650 [Asn]: Fail on strtotime('last day of this year')
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-157582@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53650&edit=1

 ID:                 53650
 Updated by:         derick@php.net
 Reported by:        tripollite at gmail dot com
 Summary:            Fail on strtotime('last day of this year')
 Status:             Assigned
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   Debian
 PHP Version:        5.3.4
 Assigned To:        derick
 Block user comment: N
 Private report:     N

 New Comment:

All right. Will check.


Previous Comments:
------------------------------------------------------------------------
[2011-01-04 19:31:24] tripollite at gmail dot com

Europe/Paris
1293840061: 2011-01-01 01:01:01 Europe/Paris
1296432061: 2011-01-31 01:01:01 Europe/Paris

------------------------------------------------------------------------
[2011-01-04 19:23:13] derick@php.net

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";
?>

------------------------------------------------------------------------
[2011-01-04 18:34:38] 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


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53650&edit=1


Thread (10 messages)

« previous php.bugs (#157582) next »