LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bash equivalent of <perl -e 'print time'> (https://www.linuxquestions.org/questions/linux-newbie-8/bash-equivalent-of-perl-e-print-time-593988/)

teabag_46 10-23-2007 02:34 PM

bash equivalent of <perl -e 'print time'>
 
Hi, I am trying to find the bash equivalent of <perl -e 'print time'> which prints the number of seconds since the epoch (January 1st 1970).

I have tried google, and also man time, man clock and man times. If I have missed something obvious please let me know.

This is for a personal project, not homework, and there is no real rush.

Thanks.

The_JinJ 10-23-2007 02:42 PM

date --date='2007-10-23 20:41:00 GMT' +%s

%s is number of seconds since the epoch

teabag_46 10-23-2007 03:04 PM

Thanks for that.

I had missed something obvious!


All times are GMT -5. The time now is 04:45 AM.