How Do You Find the Difference Between Two Timestamps in Unix?
Contents How Do You Find the Difference Between Two Timestamps? If You’d Like to Calculate the Difference Between the Timestamps in Seconds, Multiply the...
Contents
How do you find the difference between two timestamps?
If you’d like to calculate the difference between the timestamps in seconds, multiply the decimal difference in days by the number of seconds in a day, which equals 24 * 60 * 60 = 86400 , or the product of the number of hours in a day, the number of minutes in an hour, and the number of seconds in a minute.
Must Read
How do I subtract two timestamps in Linux?
If you want to process the date using simple command line tools, you need to convert the timestamps into some easy-to-deal-with format, like epoch-based. Then you can subtract to get a number of milliseconds representing the diff.