How can I convert the uptime
output to seconds since epoch to compare with dmesg
output? Does uptime have the same resolution as the kernel message time? Is there a way to more directly get the kernel time than from uptime
?
➜ ~ echo "hi" > /dev/kmsg
➜ ~ dmesg | tail
[ 859.214564] hi
➜ ~ uptime
10:08 up 2 days, 43 secs, 2 users, load averages: 1.69 1.64 1.54
dmesg
output isn't seconds since the epoch. What problem are you trying to solve? Are you talking purely about 'time since boot' rather than epoch or kernel time?