mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Merge branch 'PHP-7.1'
This commit is contained in:
commit
546dd2af96
1 changed files with 30 additions and 0 deletions
30
ext/date/tests/bug74652.phpt
Normal file
30
ext/date/tests/bug74652.phpt
Normal file
|
@ -0,0 +1,30 @@
|
|||
--TEST--
|
||||
Test for bug #74652: Incomplete dates
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
$formats = [
|
||||
'2017-03-25 10:52:09',
|
||||
'2017-03-25 10:52',
|
||||
'2017-03-25 10am',
|
||||
'2017-03-25',
|
||||
'2017-03',
|
||||
'2017.042',
|
||||
'2017043',
|
||||
];
|
||||
|
||||
foreach ( $formats as $format )
|
||||
{
|
||||
$dt = new DateTimeImmutable( $format );
|
||||
echo $dt->format( 'Y-m-d H:i:s' ), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
2017-03-25 10:52:09
|
||||
2017-03-25 10:52:00
|
||||
2017-03-25 10:00:00
|
||||
2017-03-25 00:00:00
|
||||
2017-03-01 00:00:00
|
||||
2017-02-11 00:00:00
|
||||
2017-02-12 00:00:00
|
Loading…
Add table
Add a link
Reference in a new issue