date -d "Jun 15 11:10:11" +%s 1371265811日期格式化
date -d "May 20 13:14:20" "+%Y-%m-%d %H:%M:%S" 2013-05-20 13:14:20 date "+%Y-%m-%d %H:%M:%S" 2013-06-15 12:00:57生成時間戳
date -d "May 20 13:14:20" +%Y%m%d%H%M%S 20130520131420 date +%Y%m%d%H%M%S 20130520131420計算時間差
start=$(date -d "Jun 15 11:10:11" "+%s") echo $start #1371265811 end=$(date -d "Jun 15 15:10:11" "+%s") echo $end #1371280211 limit=$(($end - $start)) echo $limit #14400 hour=$(($limit / 60 / 60)) echo $hour #4