Convert ISO 8601 to Unix Timestamp
To convert an ISO 8601 string back to a Unix timestamp, the parser reads the date, time, and zone designator, resolves the absolute instant, and counts seconds from the epoch. Offsets like +05:30 and the 'Z' suffix are honoured.
Paste your ISO string below for the seconds and millisecond values, ready for storage or arithmetic.
Worked example
Input 2023-11-14T22:13:20+00:00 converts to 1700000000:
- UTC
- Tue, 14 Nov 2023, 22:13:20 UTC
- ISO 8601 (UTC)
- 2023-11-14T22:13:20.000Z
- RFC 3339 (UTC)
- 2023-11-14T22:13:20Z
- RFC 2822
- Tue, 14 Nov 2023 22:13:20 +0000
- Unix seconds
- 1700000000
- Unix milliseconds
- 1700000000000
- Microseconds
- 1700000000000000
- Nanoseconds
- 1700000000000000000
- Hex (seconds)
- 0x6553f100
- Binary (seconds)
- 1100101010100111111000100000000
Code examples
JavaScript
const d = new Date(1700000000000); console.log(d.toISOString()); // 2023-11-14T22:13:20.000Z Math.floor(Date.now() / 1000); // current epoch
Python
from datetime import datetime, timezone print(datetime.fromtimestamp(1700000000, tz=timezone.utc)) # 2023-11-14T22:13:20.000Z import time; int(time.time())
Go
package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Unix(1700000000, 0).UTC()) // 2023-11-14T22:13:20.000Z
fmt.Println(time.Now().Unix())
}See all 14 languages on the code examples pages.
Frequently asked questions
- Does the offset change the resulting timestamp?
- Yes. 2023-11-14T22:13:20Z and 2023-11-15T03:43:20+05:30 are the same instant and produce the same Unix timestamp.
- What if the string lacks an offset?
- It is treated as local time by the browser, which can be ambiguous. Always include 'Z' or an explicit offset for reliable conversion.
- Are fractional seconds supported?
- Yes — values like 2023-11-14T22:13:20.500Z keep millisecond precision in the output.