On Linux you can convert a date like \"2010-10-02\" to a unix timestamp in shell script by
date -d \"2010-10-02\" \"+%s\"
Since Mac OS does not
I used the following on Mac OSX.
currDate=`date +%Y%m%d` epochDate=$(date -j -f "%Y%m%d" "${currDate}" "+%s")