|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-21 00:25 UTC] iliaa@php.net
[2007-03-21 09:41 UTC] derick@php.net
[2007-04-11 14:37 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 02:00:01 2025 UTC |
Description: ------------ strtotime() fails when supplied with both a negative and positive argument. This worked in php 5.0.5 and php 4.x.x. +- = - ++ = + -- = + Reproduce code: --------------- $offset = -60; $ts = strtotime('2000-01-01 12:00:00'); $result = date("Y-m-d H:i:s", strtotime("+$offset minutes", $ts)); echo $result; Expected result: ---------------- 2000-01-01 11:00:00 Actual result: -------------- 1970-01-01 01:00:00