python 时间
来源:互联网 发布:mac php ext 目录 编辑:程序博客网 时间:2024/05/12 06:50
import datetimenow = datetime.datetime.now()printprint "Current date and time using str method of datetime object:"print str(now)printprint "Current date and time using instance attributes:"print "Current year: %d" % now.yearprint "Current month: %d" % now.monthprint "Current day: %d" % now.dayprint "Current hour: %d" % now.hourprint "Current minute: %d" % now.minuteprint "Current second: %d" % now.secondprint "Current microsecond: %d" % now.microsecondprintprint "Current date and time using strftime:"print now.strftime("%Y-%m-%d %H:%M")
Current date and time using str method of datetime object:2008-06-26 11:33:15.309236Current date and time using instance attributes:Current year: 2008Current month: 6Current day: 26Current hour: 11Current minute: 33Current second: 15Current microsecond: 309236Current date and time using strftime:2008-06-26 11:33
0 0
- PYTHON时间
- python 时间
- python 时间
- python 时间
- python 时间
- Python 时间
- python时间
- [Python] Python时间操作
- python时间转为时间戳
- python时间转为时间戳
- python-时间戳转换时间
- python中的时间操作
- python计算时间
- Python格式化日期时间
- Python 日期时间格式化
- python 当前时间
- python常用时间操作
- python中的时间
- ws之XFireProxyFactory简单配置
- 读jQuery之五(取DOM元素)
- XFire完整入门教程
- struts2的json-default和struts-default的区别
- jsp exception对象获取异常信息
- python 时间
- jQuery插件之清空区域内容
- 读jQuery之六(缓存数据)
- 读jQuery之七(判断点击了鼠标哪个键)
- 读jQuery之八(包装事件对象)
- 读jQuery之十(事件模块概述)
- 用C语言实现Ping程序功能
- 递归json字符串
- itext经验总结( 转)