在 Python 中获取格式化的时间
根据需要,可以对任意时间进行格式化,但获得可读时间格式的简单方法是 asctime() −
示例
#!/usr/bin/python import time; localtime = time.asctime( time.localtime(time.time()) ) print "Local current time :", localtime
输出
将产生以下结果 −
Local current time : Tue Jan 13 10:17:09 2009
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP