where to change in linux code to convert dmesg uptime to UTC format(human readable)
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
where to change in linux code to convert dmesg uptime to UTC format(human readable)
Hi All,
I changed the line CONFIG_PRINTK_TIME=y in kernel-2.6.32-x86_64.config to get dmesg timestamp. I am getting the time stamp in the following:
[ 5.967800] mbr: 0x80 0x00 0x00 0x00 0x01 0x01 0x00 0x83 0x55 0xaa
[ 5.974417] sd 0:2:0:0: [sda] 285155328 512-byte logical blocks: (145 GB/135 GiB)
[ 5.982530] sd 0:2:0:0: [sda] Write Protect is off
I want to convert this uptime demsg to UTC format dmesg (Human readable format). For that where do i need to change in linux code. I dont want any script and all. I need to change in linux code and need to install the image in several servers.
this is the command. just type it into a terminal.
Ok.. Thanks for your kind information. But everytime i dont type this command in termainal. The server booting time itself , i need to see the dmesg time stamp in UTC format not in uptime.
The "timestamp" you are seeing in every record is a monotonically increasing timestamp in microseconds (unsigned 64 bit integer) There is no code in the kernel to output it in a date format.
The "timestamp" you are seeing in every record is a monotonically increasing timestamp in microseconds (unsigned 64 bit integer) There is no code in the kernel to output it in a date format.
This is partly because during parts of the boot (device initialization) there is no date available yet.
That "time-stamp" is kernel active time since boot. It's a duration, not a date. And it has holes in it, although as pointed out, guaranteed to be increasing. Useful for the kernel (devs), maybe not the rest of us.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.