shell獲取當前時間(轉載)

shell 實現獲取當前時間,並進行格式轉換的方法:shell 1)原格式輸出bash 2018年 09月 30日 星期日 15:55:15 CSTblog time1=$(date) echo $time1   2)時間串輸出class 20180930155515變量 1 #!bin/bash 2 time2=$(date "+%Y%m%d%H%M%S") 3 echo $time2    3
相關文章
相關標籤/搜索