Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and back. Supports multiple timezones, relative time output, and Carbon format strings for PHP developers.
Timestamp → Date
Date → Timestamp
What is a Unix Timestamp Converter?
A Unix timestamp converter translates a Unix epoch timestamp (an integer representing seconds since 1 January 1970 00:00:00 UTC) into a human-readable date and time, and vice versa. Unix timestamps are the universal currency for date/time storage in databases - timezone-agnostic, sortable as integers, and unambiguous across locale settings. This free online Unix timestamp converter shows the date in multiple timezones simultaneously, calculates relative time ("3 days ago", "in 2 hours"), and outputs the Carbon format string for PHP developers.
Milliseconds vs seconds
PHP's time() and most database TIMESTAMP columns use seconds. JavaScript's Date.now() and most browser APIs use milliseconds. If you paste a 13-digit number (like 1704067200000) and get a date far in the future, divide by 1000 to convert milliseconds to seconds. The tool auto-detects millisecond timestamps based on the number of digits.
Frequently Asked Questions
What does Unix timestamp 0 equal?
Timestamp 0 is January 1, 1970 at 00:00:00 UTC - the Unix epoch. Negative timestamps represent dates before the epoch. The maximum 32-bit signed Unix timestamp is 2,147,483,647 (January 19, 2038), after which systems using 32-bit integers overflow - the Year 2038 problem. Modern systems use 64-bit timestamps, which won't overflow for billions of years.
How do I get the current Unix timestamp in PHP?
time() returns the current timestamp as seconds. For milliseconds: (int)(microtime(true) * 1000). In Laravel with Carbon: now()->timestamp (seconds) or now()->valueOf() (milliseconds). To create a Carbon instance from a timestamp: Carbon::createFromTimestamp(1704067200).
How do I store dates in a database correctly?
Store dates as UTC timestamps, never as local time. Use MySQL/MariaDB's TIMESTAMP type (auto-converts to UTC) or DATETIME with an explicit UTC value. In Laravel, Eloquent's created_at and updated_at columns are managed automatically and cast to Carbon instances with ->toDateTimeString() for display.
How do timezones affect Unix timestamps?
Unix timestamps are always UTC-based - they don't change with timezone. The timezone only affects how the timestamp is displayed to humans. The same timestamp 1704067200 is "2024-01-01 00:00:00 UTC", "2023-12-31 19:00:00 EST", and "2024-01-01 09:00:00 JST" - they all refer to the same moment.