date命令进行纪元秒与时间的转换

Use the date command in linux to transform from utc second to date.

Display the utc second since 1970-01-01 00:00:00 UTC.

To now.
#date +%s (lower case)
1253515801

To the date we specifeid.

# date -d “20091001 00:00:00” +%s
1254326400

And vice versa.

If we got a utc seconde value , and change to the date recogenized.

# date -d @1254326400
2009年 10月 01日 星期四 00:00:00 CST

此篇文章已被阅读2177 次

Add a Comment

邮箱地址不会被公开。 必填项已用*标注