code

Unix timestamps in every language

Get the current epoch, turn a timestamp into a date, and turn a date back into a timestamp — 15 languages and dialects, with copy-ready snippets.

// before you copy

Epoch seconds are always UTC-based. Formatting is not: most standard libraries render in the machine's local zone unless you ask for UTC explicitly. Check the timezone, not just the number.

Why the same number means different dates

A Unix timestamp counts seconds since 1970-01-01T00:00:00 UTC and has no timezone. The moment is fixed everywhere on Earth; only the formatting changes. A value of 1700000000 is 2023-11-14 22:13:20 in UTC, but 2023-11-15 03:43:20 in Asia/Kolkata, because that zone was offset by +05:30 at that instant.

Every snippet on these pages uses the same definition, so the number you produce in Rust will be the number your Python service expects.

advertisement