以指定格式顯示當前時間
1.date命令默認輸出的時間格式
2.自定義格式輸出當前時間
如:以“20181209211008”格式顯示當前時間
3.命令解釋
date:顯示當前時間
“”:雙引號表示弱引用,顯示引號內變量的值
+:固定格式
%Y:以數字顯示當前年份,結果:2019
%m:以數字顯示當前月份,結果:08
%d:以數字顯示當前是幾號:結果:10
%H:以數字顯示當前時間幾點:結果:14
%M:以數字顯示當前時間幾分:結果:03
%S:以數字顯示當前時間幾秒:結果:42
2.自定義格式輸出當前時間
如:以“20181209211008”格式顯示當前時間
3.命令解釋
date:顯示當前時間
“”:雙引號表示弱引用,顯示引號內變量的值
+:固定格式
%Y:以數字顯示當前年份,結果:2019
%m:以數字顯示當前月份,結果:08
%d:以數字顯示當前是幾號:結果:10
%H:以數字顯示當前時間幾點:結果:14
%M:以數字顯示當前時間幾分:結果:03
%S:以數字顯示當前時間幾秒:結果:42
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
24-5-18 X
Higurashi-kagome
2024-06-01 14:30:43
【dubbo】如何測試一個dubbo服務呢?
金大鑫要堅持
2024-06-01 14:29:53
kubeconfig 多個集羣配置 如何切換
kubectl config get-contexts kubectl config use-context <context-name> kubectl config current-context
hiningrise
2024-06-01 14:27:53
兩臺windowserver服務器配置Redis哨兵集羣
天才臥龍
2024-06-01 14:24:12
oidc-client.js踩坑吐槽貼
提伯斯
2024-06-01 14:23:02
微盟電商-以造數工廠爲底座的低成本自動化應用實現(一)
保軍Baojun
2024-06-01 14:20:12
Mac Brew install慢的問題
阿 軍
2024-06-01 14:18:02
Vue devDependencies 與 dependencies 能別
阿 軍
2024-06-01 14:18:02
mysql 超大大數據庫複製前可執行的加速導入的SQL
菊花茶
2024-06-01 14:14:21
css25 CSS Tables
emanlee
2024-06-01 14:13:21
css29 CSS Layout - The z-index Property
emanlee
2024-06-01 14:13:21
css28 CSS Layout - The position Property
emanlee
2024-06-01 14:13:21
css26 CSS Layout - The display Property
emanlee
2024-06-01 14:13:21
css31 CSS Layout - float and clear
emanlee
2024-06-01 14:13:21