Skip to content

Commit a37f845

Browse files
committed
test: add test for Time::createFromFormat() with microseconds
1 parent 8d40134 commit a37f845

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/system/I18n/TimeTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ public function testCreateFromFormat(): void
234234
$this->assertCloseEnoughString(date('2017-01-15 H:i:s', $now->getTimestamp()), $time->toDateTimeString());
235235
}
236236

237+
public function testCreateFromFormatWithMicroseconds(): void
238+
{
239+
$time = Time::createFromFormat('Y-m-d H:i:s.u', '2024-07-09 09:13:34.654321');
240+
241+
$this->assertSame('2024-07-09 09:13:34.654321', $time->format('Y-m-d H:i:s.u'));
242+
}
243+
237244
public function testCreateFromFormatWithTimezoneString(): void
238245
{
239246
$time = Time::createFromFormat('F j, Y', 'January 15, 2017', 'Europe/London');

0 commit comments

Comments
 (0)