Bug #73712 [Com]: DateTime::format returns wrong result

From: Date: Sun, 11 Dec 2016 02:18:34 +0000
Subject: Bug #73712 [Com]: DateTime::format returns wrong result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205902@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73712&edit=1 ID: 73712 Comment by: navkal at hotmail dot com Reported by: navkal at hotmail dot com Summary: DateTime::format returns wrong result Status: Not a bug Type: Bug Package: Date/time related Operating System: Ubuntu 16.04, Windows 10 PHP Version: 7.0.14 Block user comment: N Private report: N New Comment: Fascinating. Thanks for your explanation! Previous Comments: ------------------------------------------------------------------------ [2016-12-11 00:28:31] requinix@php.net Daylight savings. In the US the 2012 spring DST transition was Mar 11th at 2am. ------------------------------------------------------------------------ [2016-12-10 19:12:12] cmb@php.net Confirmed for some timezones: <https://3v4l.org/Ntilo>. ------------------------------------------------------------------------ [2016-12-10 18:42:02] navkal at hotmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=73712&edit=1

« previous php.bugs (#205902) next »