Timestamp Converter
Convert Unix timestamps to human-readable dates
Timestamp โ Date
Date โ Timestamp
About this tool
The Unix Timestamp Converter translates between Unix epoch timestamps (integer seconds or milliseconds since January 1, 1970 UTC) and human-readable dates. Unix timestamps are the standard time representation in databases, APIs, JWT tokens, server logs, and most programming languages.
When to use it
- โConverting timestamps from API responses or database records to readable dates
- โDebugging JWT token expiry โ the exp and iat claims are Unix timestamps
- โGenerating timestamp values for date range queries in SQL or APIs
- โUnderstanding what a numeric timestamp in a log file actually represents
Tips
- โJavaScript timestamps are in milliseconds โ divide by 1000 for Unix seconds.
- โThe year 2038 problem affects 32-bit signed integers, which overflow on January 19, 2038. 64-bit systems are not affected.
Frequently asked questions
Why does JavaScript use milliseconds but most APIs use seconds?
Unix time was originally defined in seconds for 32-bit systems. JavaScript's Date.now() returns milliseconds to provide sub-second precision for web performance APIs and animations. When calling REST APIs, always check the documentation โ most use second-precision Unix timestamps, while JavaScript timestamps need dividing by 1000.
What is the Year 2038 problem?
Unix time stored as a 32-bit signed integer overflows on January 19, 2038 at 03:14:07 UTC. Any system still using 32-bit timestamps for dates beyond that point will wrap around to a negative number, representing a date in 1901. 64-bit systems and modern databases are not affected โ the overflow doesn't occur until the year 292 billion.
How do I convert a JavaScript Date object to a Unix timestamp?
Use Date.now() for the current time in milliseconds, or new Date().getTime(). To get Unix seconds: Math.floor(Date.now() / 1000). To convert a specific date: Math.floor(new Date('2024-01-15').getTime() / 1000). To go the other direction: new Date(unixSeconds * 1000).
What is the difference between UTC and local time in timestamps?
Unix timestamps are always UTC (Coordinated Universal Time) โ they represent seconds since January 1, 1970 UTC regardless of timezone. When you display a timestamp as a human-readable date, it gets converted to local time by default. Always store and compare timestamps in UTC; apply timezone offsets only for display.