python时间处理之time
来源:互联网 发布:丰田 马自达知乎 编辑:程序博客网 时间:2024/06/05 07:47
# -*- coding: utf-8 -*-#Time类#time类表示时间,由时、分、秒以及微秒组成。#time类提供的实例方法和属性:# print: tm: 23:46:10from datetime import *tm = time(23,46,10)print 'tm: ',tm#time.hour、time.minute、time.second、time.microsecond:时、分、秒、微秒;#print: hour: 23, minute: 46, second: 10, microsecond: 0print 'hour: %d, minute: %d, second: %d, microsecond: %d'% (tm.hour, tm.minute, tm.second, tm.microsecond) #time.tzinfo:时区信息;#print:Noneprint 'time.tzinfo: ',tm.tzinfo#time.replace([ hour[ , minute[ , second[ , microsecond[ , tzinfo] ] ] ] ] ):创建一个新的时间对象,用参数指定的时、分、秒、微秒代替原有对象中的属性(原有对象仍保持不变);#print: 20:46:10print "time.replace: ",tm.replace(hour = 20) #time.isoformat():返回型如"HH:MM:SS"格式的字符串表示;#print:23:46:10print 'time.isoformat():', tm.isoformat() #time.strftime(fmt):返回自定义格式化字符串。在下面详细介绍
—— —— —— EOF —— —— ——
邮箱: wirelessqa.me@gmail.com
微博: http://weibo.com/wirelessqa
转载请注明来源: Once-ler — http://blog.csdn.net/wirelessqa
- python时间处理之time
- python时间处理之time
- Python之时间处理模块time
- Python之时间处理模块time
- Python时间处理之time模块
- Python中时间的处理之——Time篇
- python time时间,日期,时间戳处理
- Python时间模块之time
- Python模块学习 ---- time 日期时间处理
- python的时间处理模块 time
- python的时间处理模块 time
- Python模块学习 ---- time 日期时间处理
- Python模块学习 ---- time 日期时间处理
- python常用的时间处理模块time
- python时间处理包:datetime,time
- Python时间模块之Time模块解析
- python的时间处理模块 date time datetime
- python 时间处理(time和datetime介绍)
- chmod 子目录
- MyEclipse 9上搭建Android开发环境_日光海岸_百度空间
- JavaScript 入门基础 (六)
- python时间处理之date
- s3c2440启动代码
- python时间处理之time
- MQX3.8源代码分析:GPIO(2)时钟门控制 gpio_cpu_init()
- 组成原理——概述
- python时间处理之datetime
- deque容器源码
- 算法效率分析
- 进制应用
- Mondrian Schema详解
- 云究竟是什么