日期:2014-05-16  浏览次数:20970 次

linux date得到当前时间的毫秒

echo `expr \`date +%s%N\` / 1000000`

-----------------------------------------------------

#/bin/bash
declare startTime=`date +%s%N`;
echo `expr $startTime / 1000000`

?

-----------------------------

#/bin/bash

#test.sh
declare time_now=`expr \`date +%s%N\` / 1000000`;
echo 当前时间毫秒:$time_now;

declare time000n=`date -d \`date +%Y%m%d\` +%s%N`;

declare time_0=`expr $time000n / 1000000`;
echo 当前时间取0时0分0秒的毫秒数:$time_0

?

?