Bug 994680

Summary: RFE: journalctl option to display timestamps in UTC
Product: [Fedora] Fedora Reporter: Steve Tyler <stephent98>
Component: systemdAssignee: systemd-maint
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: johannbg, jsynacek, lnykryn, msekleta, plautrba, rvokal, stephent98, systemd-maint, vpavlin, zbyszek
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-03 13:00:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Steve Tyler 2013-08-07 18:40:41 UTC
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):
systemd-204-9.fc19.x86_64

How reproducible:
Always.

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 13:00:48 UTC
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.