[php-src] Issue #13747: Add `V` format specifier for formatting and `createFromFormat`
| From: | derickr | Date: | Mon, 18 Mar 2024 17:26:31 +0000 |
| Subject: | [php-src] Issue #13747: Add `V` format specifier for formatting and `createFromFormat` | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246607@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13747
Author: derickr
### Description
The following code:
```php
<?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
*