forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbug74298.phpt
30 lines (28 loc) · 872 Bytes
/
bug74298.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--TEST--
Bug #74298 (IntlDateFormatter->format() doesn't return microseconds/fractions)
--EXTENSIONS--
intl
--FILE--
<?php
var_dump((new \DateTime('2017-01-01 01:02:03.123456'))->format('Y-m-d\TH:i:s.u'));
var_dump((new \IntlDateFormatter(
'en-US',
\IntlDateFormatter::FULL,
\IntlDateFormatter::FULL,
'UTC',
\IntlDateFormatter::GREGORIAN,
'yyyy-MM-dd HH:mm:ss.SSSSSS'
))->format(new \DateTime('2017-01-01 01:02:03.123456', new \DateTimeZone('UTC'))));
var_dump(datefmt_create(
'en-US',
\IntlDateFormatter::FULL,
\IntlDateFormatter::FULL,
'UTC',
\IntlDateFormatter::GREGORIAN,
'yyyy-MM-dd HH:mm:ss.SSSSSS'
)->format(new \DateTime('2017-01-01 01:02:03.123456', new \DateTimeZone('UTC'))));
?>
--EXPECT--
string(26) "2017-01-01T01:02:03.123456"
string(26) "2017-01-01 01:02:03.123000"
string(26) "2017-01-01 01:02:03.123000"