|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-02-18 13:47 UTC] mike dot turpin at gmail dot com
Description:
------------
I suspect that this is a documentation problem in strtotime rather than a bug, but I think it should be pointed out in the doc as it's easy to fall into the trap.
strtotime("24:00") returns false
If you then have:
date("g:ia",strtotime("24:00"))
You will get 1:00am but might be expecting 12:00am
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 22 01:00:01 2025 UTC |
-Bug Type: Documentation problem +Bug Type: Date/time related Seems to be a bug in the 5.2 branch. Reclassifying. ==================== daniel@daniel-laptop:~$ php -r 'echo phpversion().PHP_EOL.date("g:ia",strtotime("24:00")).PHP_EOL;' 5.3.1 12:00am daniel@daniel-laptop:~$ ~/src/php-5.2.12/sapi/cli/php -r 'echo phpversion().PHP_EOL.date("g:ia",strtotime("24:00")).PHP_EOL;' 5.2.12 1:00am ====================