datetime.time():是一个时间类,这个类接受4个参数,分别代表时,分,秒,毫秒.参数的默认值是为0

 1 #!/usr/bin/env python
 2 #coding:utf8
 3 import datetime
 4 t=datetime.time(20, 00, 13, 00)
 5 print t
 6 print '*'*20
 7 print t.hour
 8 print t.minute
 9 print t.second
10 print t.microsecond
11 
12 输出结果:
13 20:00:13
14 ********************
15 20
16 0
17 13
18 0
View Code

相关文章: