source: src/router/php7/ext/date/tests/bug73426.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 6 weeks ago

update php

File size: 654 bytes
Line 
1--TEST--
2Bug #73426 (createFromFormat with 'z' format char results in incorrect time)
3--INI--
4date.timezone=UTC
5--FILE--
6<?php
7$date = '2016 12:00:00 15';
8$format = 'Y H:i:s z';
9var_dump(DateTime::createFromFormat($format, $date));
10
11$date = '16 12:00:00 2016';
12$format = 'z H:i:s Y';
13var_dump(DateTime::createFromFormat($format, $date));
14
15?>
16--EXPECTF--
17object(DateTime)#%d (%d) {
18  ["date"]=>
19  string(26) "2016-01-16 12:00:00.000000"
20  ["timezone_type"]=>
21  int(3)
22  ["timezone"]=>
23  string(3) "UTC"
24}
25object(DateTime)#%d (%d) {
26  ["date"]=>
27  string(26) "2016-01-17 12:00:00.000000"
28  ["timezone_type"]=>
29  int(3)
30  ["timezone"]=>
31  string(3) "UTC"
32}
Note: See TracBrowser for help on using the repository browser.