|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-08-18 03:01 UTC] jianonghe at gmail dot com
Description:
------------
date_parse('now');
Test script:
---------------
date_parse('now');
Actual result:
--------------
[
"year" => false,
"month" => false,
"day" => false,
"hour" => false,
"minute" => false,
"second" => false,
"fraction" => false,
"warning_count" => 0,
"warnings" => [],
"error_count" => 0,
"errors" => [],
"is_localtime" => false,
]
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
'now' is a relative time notation. However, the response doesn't contain a 'relative' section as we see with date_parse('+0 seconds') Expected result: ---------------- [ "year" => false, "month" => false, "day" => false, "hour" => false, "minute" => false, "second" => false, "fraction" => false, "warning_count" => 0, "warnings" => [], "error_count" => 0, "errors" => [], "is_localtime" => false, "relative" => [ "year" => 0, "month" => 0, "day" => 0, "hour" => 0, "minute" => 0, "second" => 0 ] ] You can deduct that 'now' was parsed as it's the only value that gives this specific result, however that's merely a workaround.