文章详情页
python - datetime时间输出的问题
浏览:192日期: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. javascript - 单页面应用怎么监听ios微信返回键?2. angular.js - 在ionic下,利用javascript导入百度地图,pc端可以显示,移动端无法显示3. javascript - 请问下面代码中的...是扩展运算符还是操作运算符?这样写是什么意思?4. javascript - 有适合开发手机端Html5网页小游戏的前端框架吗?5. html - 类似这样的弹层用什么插件写比较好?6. vue.js - vue apache 代理设置7. angular.js - 百度支持_escaped_fragment_吗?8. 我在centos容器里安装docker,也就是在容器里安装容器,报错了?9. node.js - Vue+Webpack在dev环境下没有问题build后出现莫名错误10. node.js - nodejs+express+vue
排行榜
