php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79181 Docpage miss 'v' format definition
Submitted: 2020-01-28 11:43 UTC Modified: 2020-02-02 17:23 UTC
From: b dot davide4 at virgilio dot it Assigned: cmb (profile)
Status: Closed Package: Date/time related
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
8 + 28 = ?
Subscribe to this entry?

 
 [2020-01-28 11:43 UTC] 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
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-28 15:02 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: Documentation problem +Package: Date/time related
 [2020-01-28 15:02 UTC] cmb@php.net
The 'v' format character is available as of PHP 7.3.0; cf. bug
#75577.
 [2020-02-02 17:22 UTC] 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-02-02 17:23 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-02-02 17:23 UTC] cmb@php.net
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.
 [2020-02-02 17:25 UTC] salathe@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=267faff2e96fd2152a6a5a09faf9a04c150080fa
Log: Fix #79181: Docpage miss 'v' format definition
 [2020-02-03 00:10 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&revision=349103
Log: Fix #79181: Docpage miss 'v' format definition
 [2020-02-07 06:04 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=6baae6d411c398047c5a4052c3ca245bfd8a382a
Log: Fix #79181: Docpage miss 'v' format definition
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=67d89b7abb9d7104931330c709cb70dfeed1936f
Log: Fix #79181: Docpage miss 'v' format definition
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC