User Tools

Site Tools


epoch_time_calculations

This is an old revision of the document!


Epoch time calculations

Days since Epoch

echo $(date +%s)/86400 | bc
echo $(($(date +%s)/86400))
let days=$(date +%s)/86400 ; echo $days

Days since Epoch without GNU date

If perl is installed:

perl -e ' $days=int(time()/86400);print "$days\n"; '

Epoch time on system without GNU date

perl -e 'print time(), "\n" '
epoch_time_calculations.1329386663.txt.gz ยท Last modified: 2012/02/16 10:04 by root