简体   繁体   English

如何将 dmesg 时间戳转换为自定义日期格式?

[英]How do I convert dmesg timestamp to custom date format?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图了解dmesg时间戳,发现很难将其转换为 java 日期/自定义日期格式。

Sample dmesg log:示例 dmesg 日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图理解dmesg时间戳,发现很难将其转换为将其更改为Java日期/自定义日期格式。

Sample dmesg log:样本dmesg日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期呢?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图理解dmesg时间戳,发现很难将其转换为将其更改为Java日期/自定义日期格式。

Sample dmesg log:样本dmesg日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期呢?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图理解dmesg时间戳,发现很难将其转换为将其更改为Java日期/自定义日期格式。

Sample dmesg log:样本dmesg日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期呢?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图理解dmesg时间戳,发现很难将其转换为将其更改为Java日期/自定义日期格式。

Sample dmesg log:样本dmesg日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期呢?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图理解dmesg时间戳,发现很难将其转换为将其更改为Java日期/自定义日期格式。

Sample dmesg log:样本dmesg日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期呢?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图理解dmesg时间戳,发现很难将其转换为将其更改为Java日期/自定义日期格式。

Sample dmesg log:样本dmesg日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期呢?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图理解dmesg时间戳,发现很难将其转换为将其更改为Java日期/自定义日期格式。

Sample dmesg log:样本dmesg日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期呢?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图理解dmesg时间戳,发现很难将其转换为将其更改为Java日期/自定义日期格式。

Sample dmesg log:样本dmesg日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期呢?

I am trying to understand the dmesg timestamp and find it hard to convert that to change it to java date/custom date format.我试图理解dmesg时间戳,发现很难将其转换为将其更改为Java日期/自定义日期格式。

Sample dmesg log:样本dmesg日志:

[14614.647880] airo(eth1): link lost (missed beacons)

So how do I convert 14614.647880 to a standard date?那么如何将14614.647880转换为标准日期呢?

dmesg -T may show wrong time, different from date command output. dmesg -T可能会显示错误的时间,与date命令输出不同。

Workaround is journalctl with -k, --dmesg.解决方法是带有 -k、--dmesg 的 journalctl。 I am using -k as it is shorter:我正在使用 -k 因为它更短:

journalctl -k

It will show only kernel messages and correct time.它只会显示内核消息和正确的时间。

To show only kernel lines matching phrase:仅显示匹配短语的内核行:

journalctl -kg phrase

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM