Red Hat Bugzilla – Bug 994680
RFE: journalctl option to display timestamps in UTC
Last modified: 2014-10-03 09:00:48 EDT
Description of problem:
Timestamps on journalctl records are in local time. This RFE would add an option to display timestamps in UTC.
Currently, timestamps can be displayed in UTC by presetting the TZ environment variable:
$ TZ=UTC journalctl
While this does indeed work, it adds to the syntax-burden on the user of an already complex command. Further, due to Bug 994659, bash tab-completion does not work with environment variable presets.
NB: The date command has an option to display times in UTC, even though setting the time zone with a TZ preset works:
$ TZ=UTC date
Wed Aug 7 18:28:01 UTC 2013
$ date --utc
Wed Aug 7 18:28:04 UTC 2013
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. $ journalctl
Timestamps are displayed in local time:
$ journalctl -n 1
-- Logs begin at Tue 2013-07-30 11:10:14 PDT, end at Wed 2013-08-07 11:29:08 PDT. --
Aug 07 11:29:08 walnut gnome-session: ...
Timestamps are optionally displayed in UTC:
$ journalctl -n 1 --utc
-- Logs begin at Tue 2013-07-30 18:10:14 UTC, end at Wed 2013-08-07 18:29:08 UTC. --
Aug 07 18:29:08 walnut gnome-session: ...
(Simulated with TZ=UTC preset.)
A use-case is log file correlation for logs collected in different time zones. AIUI, journalctl has log-merging capabilities, but emailing journalctl output with UTC timestamps would likely be simpler in some cases.
Related RFE: Bug 991678.
Implemented upstream as http://cgit.freedesktop.org/systemd/systemd/commit/?id=9fd290443f5f99fca0dcd4216b1de70f7d3b8db1 and http://cgit.freedesktop.org/systemd/systemd/commit/?id=a62e83b48cda6a709a796a361abaf6b129650b3c. This functionality should be available in the next stable release.