Doc #79181 [Ver->Csd]: Docpage miss 'v' format definition
Edit report at https://bugs.php.net/bug.php?id=79181&edit=1
ID: 79181
Updated by: cmb@php.net
Reported by: b dot davide4 at virgilio dot it
Summary: Docpage miss 'v' format definition
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Date/time related
Operating System: irrelevant
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2020-02-02 17:22:26] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=349094
Log: Fix #79181: Docpage miss 'v' format definition
------------------------------------------------------------------------
[2020-01-28 15:02:49] cmb@php.net
The 'v' format character is available as of PHP 7.3.0; cf. bug
#75577.
------------------------------------------------------------------------
[2020-01-28 11:43:47] b dot davide4 at virgilio dot it
Description:
------------
---
From manual page: https://php.net/datetime.createfromformat
---
On the page the format option 'v' is not documented:
(It takes the milliseconds)
Test script:
---------------
$dates = [
'short' => '20201112132455999',
'long' => '20201112132455999888'
];
$formats=[
'u' => 'YmdHisu',
'v' => 'YmdHisv'
];
foreach ($dates as $dk => $d)
foreach ($formats as $f ){
$v = DateTime::createFromFormat($f,$d);
echo "result for ".$d." with format ".$f.' is: ';
print_r( !is_a($v,'DateTime')? ['not-a-datetime'] : $v);
}
Expected result:
----------------
result for (short) 20201112132455999 with format YmdHisu is: DateTime Object
(
[date] => 2020-11-12 13:24:55.999000
[timezone_type] => 3
[timezone] => UTC
)
result for (short) 20201112132455999 with format YmdHisv is: DateTime Object
(
[date] => 2020-11-12 13:24:55.999000
[timezone_type] => 3
[timezone] => UTC
)
result for (long) 20201112132455999888 with format YmdHisu is: DateTime Object
(
[date] => 2020-11-12 13:24:55.999888
[timezone_type] => 3
[timezone] => UTC
)
result for (long) 20201112132455999888 with format YmdHisv is: Array
(
[0] => not-a-datetime
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79181&edit=1
Thread (3 messages)