What is a Unix timestamp?
A Unix timestamp is the number of seconds that have elapsed since 00:00:00 UTC on January 1, 1970, also known as the Unix epoch. It is a single integer that represents an exact moment in time, independent of timezones or calendar formats.
Why do timestamps come in seconds vs milliseconds?
Most Unix systems and many programming languages historically used seconds, while JavaScript and many newer APIs use milliseconds for higher precision. A 10-digit timestamp is almost always seconds, while a 13-digit timestamp is almost always milliseconds.
What is epoch time?
Epoch time is another name for Unix time. The Unix epoch is the reference point of January 1, 1970 at 00:00:00 UTC, and epoch time counts the seconds (or milliseconds) since that moment.
How do I convert a Unix timestamp to a date in JavaScript, Python, or SQL?
In JavaScript: new Date(unixSeconds * 1000). In Python: datetime.fromtimestamp(unixSeconds, tz=timezone.utc). In PostgreSQL: to_timestamp(unixSeconds). In MySQL: FROM_UNIXTIME(unixSeconds).
Are Unix timestamps in UTC?
Yes. A Unix timestamp is an absolute count of seconds since the epoch and does not carry timezone information. Timezones only matter when you format the timestamp into a human-readable date.