經常使用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. 運行
相關文章
相關標籤/搜索