Getting Unix Timestamps in Bash
The date command is your primary tool for retrieving Unix epoch timestamps. It’s available on virtually all Unix-like systems and integrates seamlessly into scripts and command pipelines. Basic Epoch Timestamp date +%s This returns the number of seconds since January 1, 1970 UTC. Output looks like 1735689600. Higher Precision with Nanoseconds For microsecond or nanosecond…
