Bug 994680 - RFE: journalctl option to display timestamps in UTC
RFE: journalctl option to display timestamps in UTC
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2013-08-07 14:40 EDT by Steve Tyler
Modified: 2014-10-03 09:00 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-10-03 09:00:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Steve Tyler 2013-08-07 14:40:41 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):

How reproducible:

Steps to Reproduce:
1. $ journalctl

Actual results:

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[1101]: ...

Expected results:

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[1101]: ...
(Simulated with TZ=UTC preset.)

Additional info:

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.
Comment 1 Jan Synacek 2014-10-03 09:00:48 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.