### Convert from human readable date to epoch
date +%s -d "Jan 1, 1980 00:00:01"
### Convert from epoch to human readable date
date -d @1190000000
ref: this.
epoch(unix timestamp) convert in linux
poster:
MarlboroMoo on
2009-08-26
20:59
tag:
linux tip
在 linux 計算時間, 通常的作法都是先把時間轉換成 epoch aka unix timestamp(從1970年1月1日0時0分0秒到目前時間的秒數), 再來做計算, 下方為 epoch 的轉換方式.
Related Posts:
- linux sar tip in rhel4 (centos4) - 2009-06-27
- linux tmpfs tip - 2009-06-27
- colorful log via perl - 2010-02-09
- proxy via iptables - 2010-02-09
- language support in centos - 2009-08-18
0 comments:
張貼留言