#获取当前时间到毫秒 #currentTime=`date "+%Y-%m-%d %H:%M:%S.%N"` currentTime=`date +%s%N` echo ${currentTime} #将毫秒转成时间戳 TimesTamp=`expr ${currentTime} / 1000000`