|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-03-21 07:13 UTC] finull at vip dot qq dot com
Description: ------------ Found this bug when I use strtotime to checkout if input was valid date. strtotime(1458533078) should return FALSE, but it does't; Test script: --------------- $timestamp = strtotime(1458533078); // output: 34971980333 echo $timestamp; Expected result: ---------------- FALSE Actual result: -------------- 34971980333 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 16:00:01 2025 UTC |
As a hint, if you get weird results, use date_parse, and it will tell you how it (tried to) parse the string: derick@whisky:~ $ php -r 'var_dump(date_parse("1458363078"));' Command line code:1: array(12) { 'year' => int(1458) 'month' => int(1) 'day' => int(363) 'hour' => bool(false) 'minute' => bool(false) 'second' => bool(false) 'fraction' => bool(false) 'warning_count' => int(1) 'warnings' => array(1) { [11] => string(27) "The parsed date was invalid" } 'error_count' => int(3) 'errors' => array(3) { [7] => string(20) "Unexpected character" [8] => string(20) "Unexpected character" [9] => string(20) "Unexpected character" } 'is_localtime' => bool(false) }