Skip to content

Commit 6e0f520

Browse files
codewithbearvlad.lezhnin
authored and
vlad.lezhnin
committed
fix round seconds formatting in JobResponseMapper
1 parent eb37275 commit 6e0f520

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

airbyte-server/src/main/kotlin/io/airbyte/server/apis/publicapi/mappers/JobResponseMapper.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import java.time.Duration
1616
import java.time.Instant
1717
import java.time.OffsetDateTime
1818
import java.time.ZoneId
19+
import java.time.format.DateTimeFormatter
1920

2021
/**
2122
* Mappers that help convert models from the config api to models from the public api.
@@ -63,10 +64,10 @@ object JobResponseMapper {
6364
}
6465
},
6566
// set to string for now since the jax-rs response entity turns offsetdatetime into epoch seconds
66-
startTime = OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.createdAt), UTC).toString(),
67+
startTime = DateTimeFormatter.ISO_DATE_TIME.format(OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.createdAt), UTC)),
6768
lastUpdatedAt =
6869
if (TERMINAL_JOB_STATUS.contains(jobRead.status)) {
69-
OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.updatedAt), UTC).toString()
70+
DateTimeFormatter.ISO_DATE_TIME.format(OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.updatedAt), UTC))
7071
} else {
7172
null
7273
},

0 commit comments

Comments
 (0)