說明:藍色=命令名稱
淺綠=命令參數
淺藍=選項
紫色=目錄
系統環境:CentOS 5.7 i686
名詞解釋:
Unix時間戳(英文為Unix epoch, Unix time, POSIX time 或 Unix timestamp) 是從1970年1月1日(UTC/GMT的午夜)開始所經過的秒數,不考慮閏秒。 UNIX時間戳的0按照ISO 8601規范為 :1970-01-01T00:00:00Z. 一個小時表示為UNIX時間戳格式為:3600秒;一天表示為UNIX時間戳為86400秒,閏秒不計算。 在大多數的UNIX系統中UNIX時間戳存儲為32位,這樣會引發2038年問題或Y2038。 時間 秒1 分鐘 601 小時 36001 天 864001 周 6048001 月 (30.44 天) 26297431年 (365.24 天) 31556926
linux獲得 Unix時間戳方法:awk 'BEGIN{print systime()}'
650) this.width=650;" border=0>
date 轉換法:date -d @1328075260
650) this.width=650;" border=0>
awk方法:echo "1328075260"|awk '{print strftime("%Y/%m/%d-%H:%M:%S",$0)}'或(簡化版) echo "1328075260"|awk '{$0=strftime("%Y-%m-%d-%H:%M:%S",$0)}1'
650) this.width=650;" border=0>