Let’s get a date and its corresponding unix timestamp.
dt=$(date --iso-8601=s) echo "$dt --> $(date +%s --date=$dt)" 2022-04-07T11:28:04+02:00 --> 1649323684
The number 1649323684 is composed of 10 digits, each one representing a power
of 10 for seconds, but what does that mean in human time?
For example increasing the second digit from 6 to 7 moves the timestamp 3 years into the future:
$ date --utc --iso-8601=s --date=@1649323684 2022-04-07T09:28:04+00:00 $ date --utc --iso-8601=s --date=@1749323684 2025-06-07T19:14:44+00:00
Min & Max Timestamps with 10 Digits#
$ date --utc --iso-8601=s --date=@0000000000 1970-01-01T01:00:00+00:00 $ date --utc --iso-8601=s --date=@9999999999 2286-11-20T17:46:39+00:00
Notes#
zip does not like unix time 0 https://blog.izs.me/2021/10/my-favorite-npm-commit/
Code#
To generate the above table using humanize:
import humanize import datetime as dt DIGITS = 10 for pos in range(1, DIGITS+1): pow10 = DIGITS - pos total_s = DIGITS**pow10 human = humanize.naturaldelta(total_s) print(','.join([str(x) for x in [pos, pow10, total_s, human]]))
This code is good enough for this simple one-off use-case. The
Over-Engineer Software-Engineer in my mind says:
use functions!
use yield!
use csvwriter!
output at the end!
import structlog :D