python asctime()方法将一个元组或struct_time表示时间,由gmtime()或localtime() 返回以下形式的24个字符的字符串: 'Tue Feb 17 23:21:05 2009'.
python asctime()语法
以下是 asctime() 方法的语法:
time.asctime([t]))
python asctime()参数
-
t -- 这是9个元素或struct_time表示,由gmtime()和localtime() 函数返回的时间的元组。
python asctime()返回值
此方法返回以下形式的24个字符的字符串: 'Tue Feb 17 23:21:05 2009'.
python asctime()示例
下面的例子显示 asctime() 方法的使用。
#!/usr/bin/python3
import time
t = time.localtime()
print (\"asctime : \",time.asctime(t))
当我们运行上面的程序,它会产生以下结果:
asctime : Mon Feb 15 09:46:24 2016 继续阅读与本文标签相同的文章
上一篇 :
一文道尽传统图像降噪方法
下一篇 :
Python3 time.altzone()方法
-
五大网络威胁应对挑战
2026-05-14栏目: 教程
-
能“生”的机器人,这不是玩笑!这只是机器拟人化的一小步
2026-05-14栏目: 教程
-
辉煌的背后,华为何时补齐短板?任正非给出新目标
2026-05-14栏目: 教程
-
全球首条“5G自动微公交”示范线路乌镇开通
2026-05-14栏目: 教程
-
未来十年,最为吃香的4个大学专业,毕业后就是香饽饽!
2026-05-14栏目: 教程
