bash function epoch_days

I needed to calculate days since the epoch. I wrote up a quick bash function to do the math for me.

function epoch_days() { 
    time=$(date --utc +%s);
    day=86400;
    days=$(( $time / $day ));

    echo $days;
}
Leave A Reply
All content licensed under the Creative Commons License