Python3 获取格式化时间串
2016-10-20 13:54
190 查看
在Python中如何获得格式化时间串?
得到当前时间格式化时间串:import time print(time.strftime("%Y-%m-%d %H:%M:%S"), time.localtime())
这个参数在表示当前时间的时候可以省略 time.localtime(),例如
import time print(time.strftime("%Y-%m-%d %H:%M:%S"))
输出结果:
2016-10-20 13:48:11
相关文章推荐
- python 获取时间及格式化
- python获取当前时间戳&格式化时间
- Python+Selenium中级篇之6-Python获取系统时间和格式化时间显示
- python - 根据时间戳获取当前格式化时间
- python 下获取系统时间并格式化输出
- python时间获取、格式转换、格式化符号
- Python获取当前时间及格式化
- python 获取当前时间 日期 时间戳格式化 参数
- Python获取多少小时之前的时间并格式化
- Python格式化日期时间
- 通过python获取微秒时间
- 与时间相关的SQL语句/sql获取当前时间/sql时间比较/sql时间格式化
- JS获取系统当前时间并格式化输出小函数
- 获取系统时间,并格式化
- python学习之获取当前时间的方法(可以任意取时间的任何一个对象显示)
- C语言下获取当前时间并格式化成字符串的方法-可用作截图或者录像的文件名
- 小例子--获取格式化的系统时间
- python对时间日期做格式化
- c++/c获取系统时间,并格式化输出
- Python 日期时间格式化