docker log API show timestamp does not support specify time zone
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?
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