public function testSecondsUntilEndOfDay() { $d = Date::today()->endOfDay(); $this->assertSame(0, $d->secondsUntilEndOfDay()); $d = Date::today()->endOfDay()->subSeconds(60); $this->assertSame(60, $d->secondsUntilEndOfDay()); $d = Date::create(2014, 10, 24, 12, 34, 56); $this->assertSame(41103, $d->secondsUntilEndOfDay()); $d = Date::create(2014, 10, 24, 0, 0, 0); $this->assertSame(86399, $d->secondsUntilEndOfDay()); }
public function testTodayWithTimezone() { $dt = Date::today('Europe/London'); $dt2 = new \DateTime('now', new \DateTimeZone('Europe/London')); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); }