… Or (incidentally have the same format string with *correct* result for both local- & UTC time zones) …
python3.12 -c '
import datetime as D
import os, sys
import zoneinfo as Z
TZ_SEQ = (os.environ.get("TZ"), "UTC")
for unix_sec in sys.argv[1:]:
print( unix_sec,
*( D.datetime.fromtimestamp(float(unix_sec), tz = Z.ZoneInfo(tz)).strftime("%a %b %Y%m%d-%H%M%S.%f %z %Z")
for tz in TZ_SEQ
),
sep = "\n\t: "
)
' 1234567890.543210