use case
How to convert a date to a Unix timestamp
Get the Unix epoch seconds for a specific date to use in a database, API, or JWT.
Many systems — SQL databases, REST APIs, JWT tokens, and cron schedulers — store or accept time as Unix epoch seconds. If you know the human-readable date you want but need the timestamp, this converter does it instantly. This guide shows how to convert any date string to Unix seconds and milliseconds without writing code.
Step-by-step guide
- Enter the date in ISO 8601 format: Type or paste the date as 'YYYY-MM-DDTHH:MM:SSZ' — for example, '2025-01-01T00:00:00Z' for midnight UTC on New Year's Day 2025. Always include the 'Z' suffix to specify UTC and avoid timezone ambiguity.
- Read the unix_seconds field: The unix_seconds output is the value to use in SQL timestamps, API query parameters, and JWT 'exp' or 'iat' claims. The unix_ms field is the value for JavaScript Date constructors.
- Verify with the relative time: The 'relative' field (e.g. 'in 3 days' or '6 months ago') lets you sanity-check that the timestamp represents the date you intended before inserting it into a database or generating a token.
Frequently asked questions
- How do I get the timestamp for a date in a specific timezone other than UTC?
- Append the UTC offset to the date string. For example, '2025-01-01T09:00:00+05:30' represents 9:00 AM in UTC+5:30 (India). The tool converts it to UTC internally and returns the correct Unix timestamp.
- What Unix timestamp is midnight tonight?
- Enter today's date as 'YYYY-MM-DDT00:00:00Z' for UTC midnight, or with your local UTC offset. For example, midnight Pacific Standard Time (UTC-8) on 2025-06-01 would be '2025-06-01T08:00:00Z'.
Try it now
Use the Unix Timestamp Converter to complete this task — free, no sign-up, runs in your browser.
Open Unix Timestamp Converter →