Convert Date Time Stamp To Epoch Time

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 Forum - Do you have a Linux Question?

Linux Books
Linux Certification, System Administration, Programming, Networking Books

Linux Home: Linux System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.