文章详情页
datetime - Python如何获取当前时间
浏览:242日期:2022-06-27 10:55:33
问题描述
Python如何获取当前时间,格式如下:
2017-06-23 22:12:35
问题解答
回答1:参考文章:Python获取当前时间
time模块(low level)import timetime.strftime('%Y-%m-%d %H:%M:%S')datetime模块(high level Object-oriented interface to dates and times)
import datetimedatetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
相关文章:
1. html5 - 求详解h5 video事件监听2. android - react-native 在genymotion中一直连不上server3. jupyter-notebook - Mac下启动jupyter notebook后没有Python的选项?4. javascript - vue更改当前节点元素5. angular.js - angular post的Content-Type被设置,导致不能上传图片,求助!!6. css3 - 这个效果用 CSS 可以实现吗?border-image7. android - webview 自定义加载进度条8. mac连接阿里云docker集群,已经卡了2天了,求问?9. Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?10. 如何解决Centos下Docker服务启动无响应,且输入docker命令无响应?
排行榜

网公网安备