Date to Timestamp
Convert dates into Unix timestamps.
The value above is read in your computer’s time zone.
How to use Date to Timestamp
What this tool does
This tool does the reverse of timestamp decoding: you give it a calendar date and time, and it returns the Unix timestamp for that instant. You pick the moment with a native date-and-time picker, choose whether the value should be read in your local time zone or in UTC, and the tool shows the result three ways — the timestamp in seconds, the timestamp in milliseconds, and the ISO 8601 string. Everything is computed in your browser; the date you choose is never sent anywhere.
Why you might need it
Unix timestamps are the common currency for storing and comparing moments in code.
You reach for a conversion like this when you need to seed a database row with a
specific created_at, build a test fixture that expects an exact epoch value, set a
token or cache expiry, or filter logs to “everything after this date”. Typing a
human date into a picker and copying the integer out is far quicker — and far less
error-prone — than computing epoch seconds by hand.
How to use it
- Click the Date and time field and choose the moment you want to convert. You can set the date, the hour, the minute and the second.
- Use the Interpret as toggle to say whether that value is Local time or UTC.
- Read the result: the timestamp in seconds, the timestamp in milliseconds, and the ISO 8601 string all update instantly.
- Click Now to drop in the current date and time, or Clear to start over.
- Use the copy button beside whichever value your target system expects.
Common pitfalls
The interpretation toggle is the part to get right. If your back end stores times
in UTC but you leave the toggle on Local time, the timestamp you copy will be
off by your time-zone offset — an hour, several hours, or more. Decide up front
which clock the value belongs to. A second subtlety is units: a value in seconds and
the same value in milliseconds differ by a factor of one thousand, so copying the
wrong row lands you far in the past or the future. Finally, the ISO string is always
expressed in UTC with a Z suffix; that is correct behaviour, not a bug, even when
the hours do not match what you typed.
Tips and advanced use
When you are writing tests or fixtures, copy the seconds value for most
back-end languages and the milliseconds value for JavaScript code that compares
against Date.now(). If you are coordinating an event across regions — a release, a
deadline, a maintenance window — set the picker, switch the toggle to UTC, and
share the resulting timestamp; everyone’s machine will resolve it to the correct
local moment. The ISO 8601 output is the safest format to paste into
configuration files and APIs because nearly every date parser accepts it. And since
the whole conversion runs locally, you can use it freely for internal scheduling
data without anything leaving your device.
Frequently asked questions
Is my date sent anywhere?
What is the difference between the Local time and UTC options?
Why are there both seconds and milliseconds?
Can I convert a date before 1970?
Why does the ISO string look different from what I entered?
Related tools
SQL to JSON
Convert SQL INSERT statements into JSON.
JSON Schema Generator
Infer a JSON Schema from a sample document.
ASCII Table Reference
Browse the full ASCII character reference table.
HTTP Status Codes
Look up every HTTP status code and its meaning.
HTTP Headers Reference
Reference common HTTP request and response headers.
MIME Type Lookup
Look up MIME types by file extension.