#26090 [Opn->Csd]: allow colons in time zone offset to strtotime()

From: Date: Tue, 28 Jun 2005 21:23:52 +0000
Subject: #26090 [Opn->Csd]: allow colons in time zone offset to strtotime()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81151@lists.php.net to get a copy of this message
ID: 26090 Updated by: nlopess@php.net Reported By: danielc at analysisandsolutions dot com -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: n/a PHP Version: 5.0.0b1 (beta1) New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Fixed in PHP 5.1. Previous Comments: ------------------------------------------------------------------------ [2003-11-03 00:29:30] danielc at analysisandsolutions dot com Description: ------------ The strtotime() function doesn't allow time zone offsets to contain colons ":" in them. Colons are included in several offset formmating standards. Reproduce code: --------------- $t = '2003-10-28 10:20:30-0800'; echo date('Y-m-d H:i:s T', strtotime($t)) . "\n<br />\n"; $t = '2003-10-28 10:20:30-08:00'; echo date('Y-m-d H:i:s T', strtotime($t)) . "\n"; Expected result: ---------------- 2003-10-28 13:20:30 EST <br /> 2003-10-28 13:20:30 EST Actual result: -------------- 2003-10-28 13:20:30 EST <br /> 1969-12-31 18:59:59 EST On Windows 2000, the attempt with the colons in the offset produces a negative timestamp, so the beloved "Windows does not support dates prior to midnight" warning arises. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26090&edit=1

« previous php.bugs (#81151) next »