码迷,mamicode.com
首页 > 其他好文 > 详细

date +%s 能打印出自1970-01-01 00:00:00到当前时间的秒数

时间:2016-06-22 10:54:52      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

 

[root@bass Desktop]# date +%s
1466561580
[root@bass Desktop]# python
Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 60*60*24
86400
>>> 1466561580
1466561580
>>> 1466561580/86400
16974
>>> 1466561580/86400/365
46
>>> 
>>> 1970-01-01

[root@bass Desktop]# date
Wed Jun 22 10:15:26 CST 2016

 

date +%s 能打印出自1970-01-01 00:00:00到当前时间的秒数

标签:

原文地址:http://www.cnblogs.com/bass6/p/5606143.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!