From:             praflo at gmail dot com
Operating system: gentoo linux
PHP version:      Irrelevant
Package:          Date/time related
Bug Type:         Bug
Bug description:Strange behaviour in mktime() function using leading zeros

Description:
------------
In the mktime() function if you add a "0" before the number of the month of
August or September (eg. august -> 08) the result is something wrong. See
example below.
It seems this happens only with "08" and "09", not with "07", "06", etc.

I discovered this because August 12th 2012 (08-12-2012) is the last day of
the next Olympic games in London.

Hope this helps
bye
gian

(PHP version: PHP 5.3.8-pl0-gentoo)







Test script:
---------------
<?php
$timestamp1 = mktime(23,59,59,08,12,2012);
$timestamp2 = mktime(23,59,59, 8,12,2012);

$out1 = date("m-d-Y H:i:s",$timestamp1);
$out2 = date("m-d-Y H:i:s",$timestamp2);

echo "DATE1 is : $out1\n";
echo "DATE2 is : $out2\n";

/*
output is:
DATE1 is : 12-12-2011 23:59:59 <---- IT SAYS DEC 12 2011 !!!
DATE2 is : 08-12-2012 23:59:59
*/
?>


Expected result:
----------------
DATE1 is : 08-12-2012 23:59:59
DATE2 is : 08-12-2012 23:59:59

Actual result:
--------------
DATE1 is : 12-12-2011 23:59:59
DATE2 is : 08-12-2012 23:59:59

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62364&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=62364&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=62364&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=62364&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=62364&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62364&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=62364&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=62364&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=62364&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=62364&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=62364&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=62364&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=62364&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=62364&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=62364&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=62364&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62364&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=62364&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=62364&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=62364&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=62364&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=62364&r=mysqlcfg

Reply via email to