From e708bd14a4379a4f363823f6271c87d8b0caadfe Mon Sep 17 00:00:00 2001 From: "vlad.lezhnin" Date: Tue, 3 Dec 2024 13:01:24 +0100 Subject: [PATCH] fix round seconds formatting in JobResponseMapper --- .../server/apis/publicapi/mappers/JobResponseMapper.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/airbyte-server/src/main/kotlin/io/airbyte/server/apis/publicapi/mappers/JobResponseMapper.kt b/airbyte-server/src/main/kotlin/io/airbyte/server/apis/publicapi/mappers/JobResponseMapper.kt index 940e6bad0a7..f4b4cc66c87 100644 --- a/airbyte-server/src/main/kotlin/io/airbyte/server/apis/publicapi/mappers/JobResponseMapper.kt +++ b/airbyte-server/src/main/kotlin/io/airbyte/server/apis/publicapi/mappers/JobResponseMapper.kt @@ -16,6 +16,7 @@ import java.time.Duration import java.time.Instant import java.time.OffsetDateTime import java.time.ZoneId +import java.time.format.DateTimeFormatter /** * Mappers that help convert models from the config api to models from the public api. @@ -63,10 +64,10 @@ object JobResponseMapper { } }, // set to string for now since the jax-rs response entity turns offsetdatetime into epoch seconds - startTime = OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.createdAt), UTC).toString(), + startTime = DateTimeFormatter.ISO_DATE_TIME.format(OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.createdAt), UTC)), lastUpdatedAt = if (TERMINAL_JOB_STATUS.contains(jobRead.status)) { - OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.updatedAt), UTC).toString() + DateTimeFormatter.ISO_DATE_TIME.format(OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.updatedAt), UTC)) } else { null },