Linux - Time stamp algorithm, How does time stamp calculated in linux

Time stamp algorithm

In Linux OS time stamps are printed in \"seconds since boot\". The system uptime can be helpful to calculate an absolute time stamp if needed (run the uptime command).

The algorithm below is demonstrated on the example given above:
  [196149.728085] wlan0: authenticated

Take the logs time stamp in seconds:
  196149.728085 seconds (round the number down/up if needed) 

Divide the time stamp in seconds by 60 to get the total amount of minutes:
  196150 : 60 = 3269.1667 minutes (round the number down/up if needed) 

Divide the time stamp in minutes by 60 to get the total amount of hours:
  3269.1667 : 60 = 54.486111666666666666666666666667 hours 

Break the decimal number into 2 parts:
  54.486111666666666666666666666667 hours = (54 hours) + (0.486111666666666666666666666667 decimal hours) 

Use the time conversion charts below to convert decimal hours to minutes:
 
  0.486111666666666666666666666667 decimal hours ~ 0.48 decimal hours ~ 29 minutes 
Note: For more precise conversion (down to seconds), you can use various time converters available on the Internet. Just search for convert decimal time in any search engine.

Hence, we get that the log was created this amount of time since boot:
  196149.728085 seconds ~ 54 hours 29 minutes 

Check the current system uptime:
  # uptime 
To get the logs real time stamp, subtract the logs time stamp in dmesg kernel ring buffer from the current systems uptime.

The topic on Linux - Time stamp algorithm is posted by - Sonia

Hope you have enjoyed, Linux - Time stamp algorithmThanks for your time

Tech Bluff