Bug #78426 [Asn->Nab]: Unable to parse supported time format

From: Date: Tue, 03 Nov 2020 11:53:55 +0000
Subject: Bug #78426 [Asn->Nab]: Unable to parse supported time format
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230081@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78426&edit=1

 ID:                 78426
 Updated by:         cmb@php.net
 Reported by:        jianonghe at gmail dot com
 Summary:            Unable to parse supported time format
-Status:             Assigned
+Status:             Not a bug
 Type:               Bug
 Package:            Date/time related
 Operating System:   macOS High Sierra 10.13.6 (17G21
 PHP Version:        7.3.8
 Assigned To:        derick
 Block user comment: N
 Private report:     N

 New Comment:

The documentation[1] states:

| 'now'   Now - this is simply ignored

So this is expected behavior.

[1] <https://www.php.net/manual/en/datetime.formats.relative.php>


Previous Comments:
------------------------------------------------------------------------
[2019-08-29 12:44:09] jasny@php.net

'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.

------------------------------------------------------------------------
[2019-08-18 03:01:09] 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,
]


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=78426&edit=1


Thread (1 message)

  • cmb@php.net
  • Unknown Message
    • cmb@php.net
« previous php.bugs (#230081) next »