Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !11024

Only use values up to the second accuracy for PHP datetime values

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/launchdarkly/cquan/fix-php-precision-bug into master Dec 02, 2021
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: carmenquan

https://github.com/OpenAPITools/openapi-generator/issues/10548

PHP is unable to handle highly precise DateTime Values. While this issue covered most cases, we have a few instances of DateTime which are not handled. (i.e. "2021-10-06T20:17:16.076372256Z")

Example:

print_r(strtotime("2021-10-06T20:17:16.076372256Z")); // => "" print_r(strtotime("2021-10-06T20:17:16.07637225Z")); // => "1633551436" To fix this we only use up to the second accuracy by trimming the date string. strtotime is only accurate up to number of seconds so this does not result in data loss. https://www.php.net/manual/en/function.strtotime.php

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/launchdarkly/cquan/fix-php-precision-bug