mirror of
https://github.com/php/php-src.git
synced 2024-12-03 06:44:07 +08:00
20 lines
474 B
PHP
20 lines
474 B
PHP
--TEST--
|
|
Comparing datetime objects should account for microseconds
|
|
--FILE--
|
|
<?php
|
|
|
|
date_default_timezone_set('UTC');
|
|
$date1 = DateTime::createFromFormat('U.u', '1448889063.3531');
|
|
$date2 = DateTime::createFromFormat('U.u', '1448889063.5216');
|
|
$date3 = DateTime::createFromFormat('U.u', '1448889063.5216');
|
|
|
|
var_dump($date1 == $date2);
|
|
var_dump($date1 < $date2);
|
|
var_dump($date2 > $date1);
|
|
var_dump($date2 == $date3);
|
|
--EXPECT--
|
|
bool(false)
|
|
bool(true)
|
|
bool(true)
|
|
bool(true)
|