给定一个像这样传入的参数:
~/Documents/checkout/check-out.sh potatoes '2013/05/22 13:43:00'
使用第一行或第二行,产生
st=`date --date "$2" +%s` # mogul's suggestion
st=$(date --date="$2" +%s) # Kent's suggestion
st=$(date --date="2013/05/22 14:45:00" +%s)
date: illegal option -- -
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]