How to convert the dmesg timestamps to easier to read format on Linux?

The dmesg results from newer Linux kernels show the timestamps. It seems the time in seconds since the kernel start time.

How to convert the dmesg timestamps to the real time on Linux?

asked Aug 3, 2016 by anonymous

1 Answer

The dmesg timestamp is the time in seconds since the kernel starting time.

Later dmesg has an -T option:

-T, --ctime
Print human-readable timestamps.
Be aware that the timestamp could be inaccurate! The time source used for the logs is not updated after system SUSPEND/RESUME.

So

dmesg -T

will print the real time stamps like

[Mon Oct  3 18:43:21 2016] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[Mon Oct  3 18:53:22 2016] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[Mon Oct  3 19:03:22 2016] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[Mon Oct  3 19:13:23 2016] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
answered Oct 3, 2016 by Eric Z Ma (44,280 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...