Skip to content

Add V format specifier for formatting and createFromFormat #13747

@derickr

Description

@derickr

Description

The following code:

<?php
$t = microtime(true);
$now = DateTime::createFromFormat('U.u', $t);
?>

Can fail, in case $t does only contain full seconds. Add V to allow for parsing any seconds + fraction of seconds, as well as add V to DateTimeInterface::format to reproduce the same value.

This would also allow for accepting any microtime(true) output.

PHP Version

PHP 8.3.3

Operating System

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions