datetime()
import pytz
from datetime import datetime, timedelta
utc = pytz.utc
a = datetime.utcnow() # 获取世界时间
b = datetime.utcnow().replace(tzinfo=utc)
c = datetime.now() #获取当地当时时间
d = timedelta(hours=24) #得到时间的长度
e = a - d #获取24小时之前的世界时间
f = e.strftime('%Y/%m-%d %H/%M:%S') #修改格式
print(a)
print(b)
print(c)
print(d)
print(e)
print(f)
----------
2018-11-28 06:17:30.834102
2018-11-28 06:17:30.834105+00:00
2018-11-28 14:17:30.834109
1 day, 0:00:00
2018-11-27 06:17:30.834102
2018/11-27 06/17:30
super ()
class A(object):
a = 10
def cc(self):
return 200
class B(A):
b = 20
def cc(self):
return 100
class C(B):
c = 30
def cc(self):
s = super(B,self).cc()
ss = super(C,self).cc()
sss = 300
return s,ss,sss
e = C()
print(e.cc())
-----------------
(200, 100, 300)