python日期,时间函数
2017-01-21 15:59
232 查看
获取当前格式化时间:
now_time = time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())
获取当前时间戳:
now_time = time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())
获取当前时间戳:
now_timestamp = int(time.time())
格式更改:先转换为时间数组
a = "2013-10-10 23:40:00",
timeArray = time.strptime(a, "%Y-%m-%d %H:%M:%S")
timestamp = int(time.mktime(timeArray))
otherStyleTime = time.strftime("%Y/%m/%d %H:%M:%S", timeArray)
otherStyleTime = "2013/10/10 23:40:00"
相关文章推荐
- python学习笔记——常用类库和函数——日期时间
- Python SQLite3数据库日期与时间常见函数用法分析
- Python获取时间范围内日期列表和周列表的函数
- python 时间,日期,ip,正则验证函数
- Python格式化日期时间的函数
- Python获取时间范围内日期列表和周列表的函数
- Python 日期,时间和函数的使用
- Python日期和时间函数
- ORACLE中日期和时间函数汇总
- Mysql日期和时间函数大全
- [Python]Python中实现一个时间(日期)型加几个月的运算
- mysql的日期和时间函数
- Mysql日期和时间函数
- asp下格式化时间和日期的函数
- 建立自由的会计日期的报表--1.1.认识几个有关时间的函数
- 时间,日期和本地化函数
- Mysql日期和时间函数不求人
- java中关于时间日期操作的常用函数
- Mysql日期和时间函数
- ASP日期和时间函数