How can I write human readable timestamp in linux kernel? I think do_gettimeofday returns epoch but I don’t want to try to convert it to readable time. I just want a format like Hour:Min:Sec:Msec.
Thanks
How can I write human readable timestamp in linux kernel? I think do_gettimeofday returns
Share
Later kernels have a function
time_to_tmto break epoch time into human readable format.Here’s an example:
Again, this is only available in later kernels. The second parameter
time_to_tmis an offset to the epoch time. In my local time is 0, I don’t know which one you should use.