Unix Timestamp
Convert Unix timestamps to human-readable dates and vice versa with precision and ease
What does this Unix Timestamp Converter do?
This tool converts between human readable dates and Unix timestamps in both directions. Type or pick a date and time and it returns the matching timestamp in seconds and milliseconds, or paste in a timestamp and it decodes the exact date and time it represents in both UTC and your local timezone. A live strip at the top also shows the current Unix timestamp, UTC clock, and local clock, updating every second, so you always have a reference point while you work.
How to Use This Unix Timestamp Converter?
- Convert a date to a timestamp. Type a date and time into the Date & Time field, or click Use Now to fill in the current moment, then click Convert to see the matching Unix timestamp.
- Check the timezone badge. The field shows which timezone offset your input is being interpreted in, so there’s no guessing about how the date is read.
- Read both timestamp formats. The result appears as both a seconds value and a milliseconds value, each with its own copy button.
- Convert a timestamp to a date. Paste a Unix timestamp into the second field, in either seconds or milliseconds, and click Convert.
- Review the UTC and local dates. The decoded date appears in both UTC and your local timezone, along with a relative time badge like “3 hours ago” or “in 2 days”.
- Open the full breakdown. Every conversion also fills in the Date Components Breakdown panel below with the year, month, day, ISO 8601 string, day of year, week number, and more.
Built-In Features
Live Timestamp Clock
The current Unix timestamp, UTC time, and local time update every second at the top of the tool, giving you a constant reference without needing to convert anything.
Two Way Conversion
One card turns a date and time into a timestamp, the other decodes a timestamp back into a readable date, so you never need a second tool for the reverse direction.
Seconds or Milliseconds Detection
Paste a timestamp in either seconds or milliseconds and the tool figures out which one it is based on the value’s length, so you don’t need to specify the unit yourself.
Relative Time Badge
Every decoded timestamp shows how far in the past or future it falls, from “just now” up to years, so you can gauge the gap at a glance without doing the math yourself.
Full Date Components Breakdown
Every conversion fills a detailed panel with the year, month, day, hour, minute, second, millisecond, ISO 8601 string, day of year, and week number all in one place.
One Click Copy
Every result field, from timestamps to formatted dates, has its own copy button, with a checkmark confirming the value was successfully copied to your clipboard in just one click.
What Is a Unix Timestamp?
A Unix timestamp, also called epoch time, is the number of seconds that have passed since midnight on January 1, 1970, in UTC. Instead of storing a date as separate year, month, and day fields, systems store it as a single number, which makes it easy to sort, compare, and calculate differences between dates without worrying about calendars, timezones, or leap years. Databases, APIs, log files, and programming languages all rely on it as a compact, unambiguous way to represent a moment in time.
Milliseconds are sometimes used instead of seconds when more precision is needed, which is why this tool always shows both and automatically detects which unit a pasted timestamp is written in.
How to Convert a Unix Timestamp in Code
Once you have the timestamp you need from this tool, you’ll often have to reproduce that same conversion inside a script, a spreadsheet formula, or a query. The exact syntax differs by language, so here’s a quick reference for some of the most common ones.
JavaScript
JavaScript’s Date object expects milliseconds, so a timestamp given in seconds needs to be multiplied by 1000 first, for example new Date(timestamp * 1000), before it can be read as a normal date.
Python
Python’s datetime module works in seconds by default, so datetime.fromtimestamp(timestamp) turns a Unix timestamp straight into a readable date and time object.
Excel and Google Sheets
Both spreadsheets treat dates as days since a different starting point, so a common formula is timestamp / 86400 + DATE(1970,1,1), formatted as a date and time cell for easy reading and accurate conversion.
SQL
Most SQL databases have a built-in function for this, such as FROM_UNIXTIME(timestamp) in MySQL or TO_TIMESTAMP(timestamp) in PostgreSQL, which converts the stored number straight into a date column.
Whichever language you’re working in, the seconds or milliseconds value copied from this tool is exactly what these formulas and functions expect as their input.
How Unix Timestamp Conversion Works
Converting between a date and a timestamp is really just counting seconds from a fixed starting point, but the details matter, especially when timezones are involved.
Date to Timestamp
When you type a date and time, the tool reads it as your local time, based on the timezone offset shown next to the field, then converts that moment into the number of seconds and milliseconds since the epoch.
Timestamp to Date
When you paste a timestamp, the tool checks its size to decide whether it’s in seconds or milliseconds, then counts that many units forward from the epoch to work out the matching UTC and local date and time for your selected time zone automatically
Because the underlying number always represents the same instant in UTC, a timestamp never changes when it’s viewed from a different timezone, only its formatted display does.
Seconds vs Milliseconds: Which One Am I Looking At?
Most programming languages use seconds for Unix timestamps, but JavaScript’s Date object and several web APIs use milliseconds instead. Mixing the two up is one of the most common sources of date bugs, since a value meant to be read as milliseconds will look like a date thousands of years in the future if it’s read as seconds by mistake.
| Digit Count | Likely Unit | Common Source |
|---|---|---|
| 10 digits | Seconds | Unix system clocks, most backend languages, databases |
| 13 digits | Milliseconds | JavaScript Date.now(), many web and mobile APIs |
If you’re not sure which unit a value uses, paste it into the Timestamp to Date field. The tool detects the unit automatically and shows you the decoded result either way.
Common Reasons to Use a Unix Timestamp Converter
Reading API and Log Data
API responses and server logs often store dates as raw timestamps inside a JSON payload. Once you’ve decoded the timestamp you need here, a JSON Formatter makes the rest of that payload easier to read at a glance.
Debugging Database Records
Many databases store created_at and updated_at fields as raw timestamps. Converting them to a readable date helps confirm a record’s true age while you’re tracking down a bug or investigating unexpected data changes.
Scheduling and Expiry Values
Tokens, cache entries, and scheduled jobs often use a timestamp to mark when they expire or should run. Decoding that number tells you exactly when the event is set to happen.
Preparing Test Data
When writing tests or seeding sample data, it’s often much faster to generate a timestamp for a specific date here than to manually calculate it inside your code every single time.
Useful Tips
Watch the Timezone Badge
The badge next to the date field always confirms which offset your input is being read in, so double check it before converting a date that matters.
Copy Straight into Code
Use the copy button next to the seconds or milliseconds result to grab the exact value you need without retyping it into your script or query.
Use ISO 8601 for APIs
If an API or config file expects an ISO 8601 string rather than a raw number, check the breakdown panel, which lists it alongside the rest of the decoded components.
Let the Tool Detect the Unit
You don’t need to know in advance whether a timestamp is in seconds or milliseconds. Paste it as is and the tool works out the correct unit for you.
Frequently Asked Questions
What is a Unix timestamp?
A Unix timestamp is the number of seconds that have passed since midnight on January 1, 1970, in UTC. It represents a single moment in time as one number instead of separate date fields.
What is the current Unix timestamp right now?
The live strip at the top of the tool shows the current Unix timestamp in seconds, updating automatically every second, so you don’t need to run a conversion to see it.
How do I convert a Unix timestamp to a date?
Paste the timestamp into the Timestamp to Date field and click Convert. The tool shows the matching date and time in both UTC and your local timezone.
How do I convert a date to a Unix timestamp?
Type or select a date and time in the Date & Time to Timestamp field, or click Use Now for the current moment, then click Convert to get the result in both seconds and milliseconds.
Does this tool support milliseconds as well as seconds?
Yes. Every date conversion returns both a seconds value and a milliseconds value, and the Timestamp to Date field automatically detects which unit a pasted value is written in.
What timezone is used when I type a date?
Dates you type are interpreted in your browser’s local timezone. The offset being used is shown as a badge next to the input field.
What does the relative time badge mean?
After decoding a timestamp, a badge shows how far that moment is from right now, such as “5 minutes ago” or “in 3 days”, based on your device’s current time.
Why do I get an error when converting a date?
The date field expects a format like YYYY-MM-DD HH:MM:SS, optionally with milliseconds. An incomplete or invalid date triggers a validation message so you can correct it.
Why do I get an error when converting a timestamp?
The timestamp field only accepts whole numbers. Decimal values or non-numeric text will trigger a validation message asking for a valid integer timestamp.
What is included in the Date Components Breakdown?
It lists the year, month, day, hour, minute, second, and millisecond, along with the Unix value in seconds and milliseconds, the ISO 8601 string, the day of the year, and the week number.
Can I copy the results with one click?
Yes. Every result field has its own copy button that copies the value to your clipboard and briefly shows a checkmark to confirm it worked.
Is this Unix timestamp converter free?
Yes. The tool is free to use and does not require an account or sign-up.
Does this tool work on mobile devices?
Yes. The layout adjusts to smaller screens, and every feature works the same way on phones, tablets, and desktop browsers.
