Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date_parse_from_format error when parsing 'Gis' format #1264

Closed
assertio-dani opened this issue Dec 27, 2021 · 2 comments
Closed

date_parse_from_format error when parsing 'Gis' format #1264

assertio-dani opened this issue Dec 27, 2021 · 2 comments
Assignees

Comments

@assertio-dani
Copy link

Description

While '60101' is a valid date in 'Gis' format (06:01:01), parsing it with date_parse_from_format will result in an error.

<?php
var_export(date_parse_from_format('Gis', '60101'));

Resulted in this output:

array (
  'year' => false,
  'month' => false,
  'day' => false,
  'hour' => 60,
  'minute' => 10,
  'second' => 0,
  'fraction' => 0.0,
  'warning_count' => 1,
  'warnings' => 
  array (
    5 => 'The parsed time was invalid',
  ),
  'error_count' => 1,
  'errors' => 
  array (
    4 => 'A two digit second could not be found',
  ),
  'is_localtime' => false,
)

PHP Version

PHP 8.1.1 (cli) (built: Dec 21 2021 19:35:25)

Operating System

docker image php:8.1-cli

@damianwadley
Copy link

See https://bugs.php.net/bug.php?id=79685, which I had changed to a doc bug but I'll let someone else make that decision here.

@derickr
Copy link
Contributor

derickr commented Dec 27, 2021 via email

@damianwadley damianwadley transferred this issue from php/php-src Dec 27, 2021
claudepache pushed a commit to claudepache/php-doc-en that referenced this issue Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants