cli icon indicating copy to clipboard operation
cli copied to clipboard

docker log API show timestamp does not support specify time zone

Open elvys-zhang opened this issue 1 year ago • 1 comments

Description

When I call docker logs -t, either by cli or Python API, it returns only UTC timestamp. Could you please support specify timezone while calling docker logs -t?

elvys-zhang avatar Jul 09 '25 10:07 elvys-zhang

Thanks for opening this ticket.

For the API, this is by design, and not something that will change. Using UTC is generally recommended; it allows correlating events, even if multiple daemons/environments are used, which may be in different locations (and timezone). More discussion can be found in

  • https://github.com/moby/moby/pull/35051

For the CLI (the docker logs / docker container logs commands), there's an existing ticket but it's not been worked on yet. The proposal is to make changing the timezone a feature when presenting the timestamps; this allows reading the logs in whatever timezone the client is;

  • https://github.com/docker/cli/issues/604

Ill close this as duplicate but feel free to continue the conversation

thaJeztah avatar Jul 09 '25 14:07 thaJeztah