|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-13 09:15 UTC] sniper@php.net
[2006-01-13 12:01 UTC] derick@php.net
[2006-01-13 15:14 UTC] tim at komta dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 19:00:01 2025 UTC |
Description: ------------ Prior to PHP 5.1.2 (potentially earlier, just only noticed it) strtotime(), when used with the optional 'now' argument, would return the time using the full 'now'. Now it returns 00:00 on the date of the 'now', ignoring hours, minutes, and seconds. Reproduce code: --------------- $this_morning = strtotime('today 00:00:00'); $tonight = strtotime('today 23:59:59'); echo date('m/d Hi', strtotime('yesterday', $this_morning)).'<br/>'; echo date('m/d Hi', strtotime('yesterday', $tonight)).'<br/>'; Expected result: ---------------- (as of 2005-01-12): 01/11 0000 01/11 2359 Actual result: -------------- (as of 2005-01-12): 01/11 0000 01/11 0000