Convert Unix epoch timestamps to readable dates — and back
A Unix timestamp (also called epoch time) is the number of seconds that have elapsed since January 1, 1970 00:00:00 UTC — known as the Unix epoch. It's a standard way to represent time in programming because it's timezone-independent, always increases, and is easy to calculate differences with.
Unix timestamps in seconds are 10 digits (e.g. 1700000000). Millisecond timestamps are 13 digits (e.g. 1700000000000). JavaScript's Date.now() returns milliseconds; most Unix/Linux systems use seconds. Always check which format your API or database expects.