Shell script date calculations

#!/bin/sh before=”$(date +%s)” echo $before sleep 5 Ymd=”$(date ‘+%Y%m%d’)” echo $Ymd after=”$(date +%s)” echo $after elapsed_seconds=”$(expr $after – $before)” echo Elapsed time for code block:...

Date Calc using PHP

Need to calculate a date in the future or past? $eight_days_ago = date(‘Ymd’, mktime(0,0,0,date(“m”),date(“d”)-8,date(“Y”)));