Bug 994680 - RFE: journalctl option to display timestamps in UTC
Summary: RFE: journalctl option to display timestamps in UTC
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-07 18:40 UTC by Steve Tyler
Modified: 2014-10-03 13:00 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-03 13:00:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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