diff --git a/src/AbsoluteDateClock.php b/src/AbsoluteDateClock.php index a129c15..089eb20 100644 --- a/src/AbsoluteDateClock.php +++ b/src/AbsoluteDateClock.php @@ -9,7 +9,7 @@ class AbsoluteDateClock { - public static function now(\DateTimeZone $timeZone): AbsoluteDate + public static function now(\DateTimeZone $timeZone = null): AbsoluteDate { return self::relative('now', $timeZone); } diff --git a/tests/AbsoluteDateClockTest.php b/tests/AbsoluteDateClockTest.php index fea62f9..1162ff3 100644 --- a/tests/AbsoluteDateClockTest.php +++ b/tests/AbsoluteDateClockTest.php @@ -25,6 +25,14 @@ public function testNow(): void ); } + public function testNowWithoutDateTimeZone(): void + { + self::assertEquals( + '2025-03-12', + AbsoluteDateClock::now() + ); + } + public function testRelative(): void { self::assertEquals(