Question: How to Convert the date and time stamp to epoch time? Answer: In the bash shell, the command to get the epoch time stamp is "date +%s" (no quotes), but that returns the current epoch time. You could build a shell function (script) to calculate the equivalent epoch time using the following information: The current epoch time consists of the number of seconds since midnight, January 1, 1970. 1 minute = 60 seconds 1 hour = 3600 seconds 1 day = 86400 seconds 1 week = 604800 seconds 1 month (30.44 days) = 2629743 seconds 1 year (365.24 days) = 31556926 seconds This information (and much more) comes from Epoch Converter.
Have a Linux Problem
Linux Books
Linux Home: Linux System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|