经常使用shell(1):shell获取系统当前时间戳

1. shell脚本以下 current=`date "+%Y-%m-%d %H:%M:%S"` timeStamp=`date -d "$current" +%s` #将current转换为时间戳,精确到毫秒 currentTimeStamp=$((timeStamp*1000+`date "+%N"`/1000000)) echo $currentTimeStamp 2. 运行
相关文章
相关标签/搜索