28 lines
442 B
Python
Executable File
28 lines
442 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
import datetime
|
|
|
|
""""""
|
|
|
|
TIMESTAMPS = (
|
|
161252911000,
|
|
162352411900,
|
|
1646927061000,
|
|
166691206100000,
|
|
)
|
|
|
|
def from_stamp(i: int) -> str:
|
|
dt = str(i)
|
|
if len(dt)>10:
|
|
dt = dt[:10]
|
|
sdt = str(datetime.datetime.fromtimestamp(int(dt)))
|
|
print(f" {dt} : {sdt}")
|
|
return sdt
|
|
|
|
if __name__ == "__main__":
|
|
print("formatted UNIX dates")
|
|
for i in TIMESTAMPS:
|
|
from_stamp(i)
|
|
|
|
|