Bug #73712 [NEW]: DateTime::format returns wrong result
From: navkal at hotmail dot com
Operating system: Ubuntu 16.04, Windows 10
PHP version: 7.0.14
Package: Date/time related
Bug Type: Bug
Bug description:DateTime::format returns wrong result
Description:
------------
Used DateTime::format to format the following input:
3/11/2012 2:00
Expected result:
03/11/2012 02:00
Actual result:
03/11/2012 03:00
Observed in the following environments:
- Windows 10: XAMPP, PHP 7.0.9
- Ubuntu: PHP Version 7.0.8-0ubuntu0.16.04.2
Test script:
---------------
$input = "3/11/2012 2:00";
$dt = new DateTime( $input );
$output = $dt->format( "m/d/Y H:i" );
echo( "$input => $output <br/>" );
Expected result:
----------------
03/11/2012 02:00
Actual result:
--------------
03/11/2012 03:00
--
Edit bug report at https://bugs.php.net/bug.php?id=73712&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73712&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73712&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73712&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73712&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73712&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73712&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73712&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73712&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73712&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73712&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73712&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73712&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73712&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73712&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73712&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73712&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73712&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73712&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73712&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73712&r=mysqlcfg
Thread (4 messages)
- navkal at hotmail dot com