In [1]:
import datetime

In [2]:
dt_naive = datetime.datetime(2018, 12, 31, 5, 0, 30, 1000)

In [3]:
print(dt_naive)


2018-12-31 05:00:30.001000

In [4]:
print(dt_naive.tzinfo)


None

In [5]:
dt_aware = datetime.datetime(2018, 12, 31, 5, 0, 30, 1000,
                             tzinfo=datetime.timezone.utc)

In [6]:
print(dt_aware)


2018-12-31 05:00:30.001000+00:00

In [7]:
print(dt_aware.tzinfo)


UTC

In [8]:
print(type(dt_aware.tzinfo))


<class 'datetime.timezone'>

In [9]:
print(datetime.timezone.utc)


UTC

In [10]:
print(type(datetime.timezone.utc))


<class 'datetime.timezone'>

In [11]:
print(issubclass(type(datetime.timezone.utc), datetime.tzinfo))


True

In [12]:
tz_jst = datetime.timezone(datetime.timedelta(hours=9))

In [13]:
print(tz_jst)


UTC+09:00

In [14]:
print(type(tz_jst))


<class 'datetime.timezone'>

In [15]:
tz_jst_name = datetime.timezone(datetime.timedelta(hours=9), name='JST')

In [16]:
print(tz_jst_name)


JST

In [17]:
dt_utc = datetime.datetime(2018, 12, 31, 5, 0, 30, 1000,
                           tzinfo=datetime.timezone.utc)

In [18]:
print(dt_utc)


2018-12-31 05:00:30.001000+00:00

In [19]:
print(dt_utc.tzinfo)


UTC

In [20]:
dt_jst = datetime.datetime(2018, 12, 31, 5, 0, 30, 1000,
                           tzinfo=datetime.timezone(datetime.timedelta(hours=9)))

In [21]:
print(dt_jst)


2018-12-31 05:00:30.001000+09:00

In [22]:
print(dt_jst.tzinfo)


UTC+09:00