22 lines
689 B
PHP
22 lines
689 B
PHP
<?php
|
|
namespace nur\b\date;
|
|
|
|
use nur\t\TestCase;
|
|
|
|
class DatetimeTest extends TestCase {
|
|
function test() {
|
|
date_default_timezone_set("Indian/Reunion");
|
|
self::assertSame("Indian/Reunion", date_default_timezone_get());
|
|
|
|
$datetime = new Datetime(1634100479);
|
|
self::assertSame(1634100479, $datetime->getTime());
|
|
self::assertSame("13/10/2021 08:47:59", strval($datetime));
|
|
$datetime->wrapStart();
|
|
self::assertSame(1634068800, $datetime->getTime());
|
|
self::assertSame("13/10/2021 00:00:00", strval($datetime));
|
|
$datetime->wrapEnd();
|
|
self::assertSame(1634155199, $datetime->getTime());
|
|
self::assertSame("13/10/2021 23:59:59", strval($datetime));
|
|
}
|
|
}
|