文章详情页
python - datetime时间输出的问题
浏览:248日期: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. docker-machine添加一个已有的docker主机问题2. docker-compose中volumes的问题3. nignx - docker内nginx 80端口被占用4. docker安装后出现Cannot connect to the Docker daemon.5. dockerfile - 为什么docker容器启动不了?6. angular.js - angularjs的自定义过滤器如何给文字加颜色?7. angular.js使用$resource服务把数据存入mongodb的问题。8. javascript - 移动端 点击弹出遮罩层 加断点调试就行 不加断点就不行9. docker images显示的镜像过多,狗眼被亮瞎了,怎么办?10. javascript - 正则匹配字符串特定语句后的数字
排行榜

网公网安备