Skip to content

Commit 3cd54ca

Browse files
committed
Output ISO 8601 format #9967
Because it should be the most universally understood
1 parent 8502a7c commit 3cd54ca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Api/Scalar/TimeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class TimeType extends ScalarType
2222
public function serialize(mixed $value): mixed
2323
{
2424
if ($value instanceof ChronosTime) {
25-
return $value->format('H\hi');
25+
return $value->format('H:i');
2626
}
2727

2828
return $value;

tests/Api/Scalar/TimeTypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public function testSerialize(): void
1717
$type = new TimeType();
1818
$time = new ChronosTime('14:30:25');
1919
$actual = $type->serialize($time);
20-
self::assertSame('14h30', $actual);
20+
self::assertSame('14:30', $actual);
2121

2222
// Test serialize with microseconds
2323
$time = new ChronosTime('23:59:59.1254');
2424
$actual = $type->serialize($time);
25-
self::assertSame('23h59', $actual);
25+
self::assertSame('23:59', $actual);
2626
}
2727

2828
/**

0 commit comments

Comments
 (0)