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" '

Convert from Epoch with perl

perl -e "print scalar(localtime(1268727836))"
epoch_time_calculations.1344936281.txt.gz ยท Last modified: 2012/08/14 09:24 by root