moby / moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

Home Page:https://mobyproject.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Remote API: Inconsistent date formats in API

ahmetb opened this issue · comments

/image/json call responds Created field with UNIX epoch:

[{"Created":1405979233,"Id":"ba5877dc9beca5a0af9521846e79419e98575a11cbfe1ff2ad2e95302cff26bf","ParentId":"2318d26665eff33e9f91c4c99036751afb40eb58f944a585372bec1407828ad3","RepoTags":["ubuntu:latest"],"Size":0,"VirtualSize":192735895}

/image/{{name}}/json call responds Created field with ISO 8601 String.

{...
  "Created": "2014-07-21T21:47:13.032415435Z",
...}

This doesn't make sense. I am having really hard time writing an API client due to different deserialization of DateTime formats because you have more than one DateTime format in the API.

(I'm using API v1.13)

Additionally "inspect container" endpoint also uses ISO 8601 format whereas "list containers" uses UNIX timestamps for Created field.

This is really causing trouble in parsing the date. Making it always timestamp would help a lot.

Can be closed due to #11706

Thanks for solving this @HuKeping