|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-06-28 23:23 UTC] nlopess@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 10:00:01 2025 UTC |
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.