Python/DateTime

How to generate offest-aware timestamp

Calculate seconds from time difference

time string with timezone

import datetime
tz = datetime.timezone.utc
ft = "%Y-%m-%dT%H:%M:%S%z"
t = datetime.datetime.now(tz=tz).strftime(ft)
print(f"== Summary {t} ==")

== Summary 2022-05-19T22:48:17+0000 ==

Python/DateTime (last edited 2023-01-24 01:09:28 by PieterSmit)