xref: /PHP-8.3/ext/date/tests/bug79452.phpt (revision 091c0920)
1--TEST--
2Bug #79452 (DateTime::diff() generates months differently between time zones)
3--FILE--
4<?php
5date_default_timezone_set('America/New_York');
6
7$from = new DateTime('2019-06-01');
8$to = new DateTime('2019-10-01');
9
10var_dump($from->diff($to)->m);
11
12date_default_timezone_set('Asia/Tokyo');
13
14$from = new DateTime('2019-06-01');
15$to = new DateTime('2019-10-01');
16
17var_dump($from->diff($to)->m);
18?>
19--EXPECT--
20int(4)
21int(4)
22