|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-08-29 08:36 UTC] derick@php.net
[2002-08-29 08:50 UTC] jc at mega-bucks dot co dot jp
[2003-10-28 16:27 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 17:00:02 2025 UTC |
The docs for strtotime contain a code snippet that is supposed to catch invalid dates. It fails in this example where $str is set to "1970-1-222" and invalid date. $str = "1970-1-222"; if (($timestamp = strtotime($str)) === -1) { echo "The string ($str) is bogus"; } else { echo "$str == ". date('l dS of F Y h:i:s A',$timestamp); } The output is: 1970-1-222 == Monday 10th of August 1970 12:00:00 AM Whereas is should say that 1970-1-222 is a bogus date. Jc