xref: /php-src/ext/date/tests/bug76374.phpt (revision 091c0920)
1--TEST--
2Bug #76374 (Date difference varies according day time)
3--FILE--
4<?php
5date_default_timezone_set('Europe/Paris');
6
7$objDateTo = new dateTime('2017-10-01');
8$objDateFrom = new dateTime('2017-01-01');
9$interval = $objDateTo->diff($objDateFrom);
10echo $interval->m, "\n";
11
12$objDateTo = new dateTime('2017-10-01 12:00:00');
13$objDateFrom = new dateTime('2017-01-01 12:00:00');
14$interval = $objDateTo->diff($objDateFrom);
15echo $interval->m, "\n";
16?>
17--EXPECT--
189
199
20