In [1]:
import datetime
In [2]:
dt_now = datetime.datetime.now()
In [3]:
print(dt_now)
In [4]:
print(dt_now.tzinfo)
In [5]:
dt_now_utc = datetime.datetime.now(datetime.timezone.utc)
In [6]:
print(dt_now_utc)
In [7]:
print(dt_now_utc.tzinfo)
In [8]:
dt_now_jst = datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=9)))
In [9]:
print(dt_now_jst)
In [10]:
print(dt_now_jst.tzinfo)
In [11]:
dt_utcnow = datetime.datetime.utcnow()
In [12]:
print(dt_utcnow)
In [13]:
print(dt_utcnow.tzinfo)