文章详情页
python - datetime时间输出的问题
浏览:359日期:2022-07-24 10:37:19
问题描述
1在codecademy上学习PYTHON基础知识 学到 datetime
运行了一下代码:
from datetime import datetimenow=datetime.now()#print nowprint now.yearprint now.monthprint now.dayprint now.time"输出的问题是: 年 月 日 都没问题 就是 时间那里 不知道是啥意思。’’’2017515<built-in method time of datetime.datetime object at 0x7f7bd75f7f30>None
问题解答
回答1:from datetime import datetimenow=datetime.now()#print nowprint now.yearprint now.monthprint now.dayprint now.hourprint now.minuteprint now.secondprint now.microsecond
没有time属性
print now.date()print now.time()print now.timetuple()print now.ctime()回答2:
print now.tiem()
相关文章:
1. 创建mysqli对象与数据库连接 - 出错2. linux - 阿里云服务器上的mysql服务在客户端只能通过ssh证书连接后才能使用3. 急急国王什么梗 我是急急急急急急国王梗内涵出处介绍4. python - 请问matplotlib.pyplot.save的路径如何更改5. python - flask post提交timestamp不能作为参数,这是为什么?6. python 中文乱码问题7. php - mysql中,作为主键的字段,用int类型,是不是比用char类型的效率更高?8. 登录mysql-front出现以下错误9. mysql - 博客文章标签表结构设计问题10. python - TypeError: printBB() takes 0 positional arguments but
排行榜

网公网安备