|
|
@@ -6,7 +6,7 @@ import time |
|
|
|
|
|
|
|
# Range |
|
|
|
min_timestamp = (-2**63) |
|
|
|
max_timestamp = (2**62 - 1) |
|
|
|
max_timestamp = (2**63 - 1) |
|
|
|
|
|
|
|
# Smallest representable step |
|
|
|
epsilon = 1 |
|
|
@@ -32,6 +32,10 @@ def timestamp_to_human(timestamp): |
|
|
|
"""Convert a timestamp (integer microseconds since epoch) to a |
|
|
|
human-readable string, using the local timezone for display |
|
|
|
(e.g. from the TZ env var).""" |
|
|
|
if timestamp == min_timestamp: |
|
|
|
return "(minimum)" |
|
|
|
if timestamp == max_timestamp: |
|
|
|
return "(maximum)" |
|
|
|
dt = datetime_tz.datetime_tz.fromtimestamp(timestamp_to_unix(timestamp)) |
|
|
|
return dt.strftime("%a, %d %b %Y %H:%M:%S.%f %z") |
|
|
|
|
|
|
|