Converting epoch format to struct object_time in Python

Seconds obtained from the epoch format can be converted to a special object struct_time. Its data structure is similar to a dictionary. The object struct_time is needed for more convenient work with dates stored in epoch.

Let's get the struct_time object:

pythonnow = time.time()
res = time.localtime(now)

print(res)

Result of code execution:

pythontime.struct_time(tm_year=2025, tm_mon=12,
      tm_mday=31, tm_hour=15, tm_min=40, tm_sec=51, tm_wday=3,
      tm_yday=365, tm_isdst=0)

Now let's get the current month from struct_time. To do this, in the variable res, we access its property tm_mon through a dot:

pythonprint(res.tm_mon) # 12
Задание 1

Get the current day from struct_time.

Задание 2

Get the current hour from struct_time.

Задание 3

The following epoch is given:

pythondt = 1602314100.0

Get struct_time from it.