Make API datetime format stable - do not cut off millis

Assignee

Reporter

Sprint

Description

Datetime format in the returned JSON is not stable. It cuts off millis if they are 0.

Most notably the format changes in failingSince field.
On mysql we don't store millis, so the returned datetime has value e.g. 2020-09-01T14:14:40Z
On other DBs we store millis, so the returned datetime has value e.g. 2020-09-01T14:14:40.458Z

Even with DBs that store millis, they are probably omitted in the returned JSON completely if they are 000.

Make the datetime format stable. Millis should always be present - even if they are 000.

Steps to reproduce

None

Activity

Show:

Pavel Salamon September 7, 2020 at 2:38 PM

Millis are returned even when 000. Covered by automated tests. Code review ok.

Filip Reichman September 3, 2020 at 8:49 AM

Yes, the format is supported by Date.parse() method (https://javascript.info/date).

Jaroslav Urban September 3, 2020 at 8:10 AM

Grooming:

  • ping  if this is easy to consume in front-end

Tomas Horsky September 2, 2020 at 2:55 PM
Edited

Using format pattern "yyyy-MM-dd'T'HH:mm:ss.SSSXXX". Times are in system local timezone. Examples:

  • "failingSince" : "2020-09-02T09:37:20.000+02:00",

  • "timestamp" : "2020-09-03T08:53:45.174+02:00",

Fixed

Details

Priority

Fix versions

QA Testing

UNDECIDED
Created September 2, 2020 at 8:03 AM
Updated September 12, 2023 at 8:45 AM
Resolved September 2, 2020 at 2:55 PM