Timestamp Converter
Convert Unix timestamps (seconds, milliseconds, microseconds or nanoseconds — auto-detected) to UTC and local dates, or convert a date back to a timestamp. Live current-timestamp display and Y2038 overflow notes.
Timestamps are everywhere once you are reading logs, debugging an API or looking at a database row: ten digits for seconds and thirteen for milliseconds cover most of it, with sixteen (microseconds) and nineteen (nanoseconds) turning up occasionally. This tool detects the width automatically or takes it from you, converts in both directions, shows UTC and local time together, and notes the day of the week and the 2038 overflow.
Two practical reminders. First, the width tells you the unit — a thirteen-digit value is milliseconds, so dividing by 1000 gives seconds. Second, the year-2038 problem: a 32-bit time_t overflows at 2038-01-19 03:14:07 UTC, so older systems, from 32-bit embedded hardware to legacy database columns, store dates beyond that point incorrectly; this tool flags input it cannot represent rather than returning a wrong date.
Did this tool solve your problem?
Submitting sends the tool name, your input and the current result to the server. Please do not include ID numbers, phone numbers or other private data.
AI assistant It answers using your current input and result
Asking again sends your current input and result to the server once more. Please do not include private data.
How to use
- Paste a timestamp; the unit is detected from its length, or set it manually.
- Read the UTC and local representations together.
- Check the day of the week and any 2038 overflow warning.
- Use the reverse direction to turn a date and time into a timestamp.
How it works
What a Unix timestamp is
A Unix timestamp is the number of seconds elapsed since 1970-01-01 00:00:00 UTC, excluding leap seconds. JavaScript and Java commonly use milliseconds (13 digits); 10-digit seconds appear in logs and databases.
Seconds, milliseconds, microseconds
Timestamp 1000000000 corresponds to 2001-09-09 01:46:40 UTC (Sunday); 1234567890 corresponds to 2009-02-13 23:31:30 UTC. Digit count sets the unit: up to 10 digits means seconds, 13 milliseconds, 16 microseconds, 19 nanoseconds.
Timezones and timestamps
Converting a date to a timestamp depends on the timezone: 2026-09-11 00:00:00 is 1789104000 in UTC but 1789056000 in UTC+8 — 8 hours apart. Results copy in one click as seconds or milliseconds.
Code example
JavaScript Converting between seconds and milliseconds
const sec = Math.floor(Date.now() / 1000); // 10-digit seconds
const ms = Date.now(); // 13-digit milliseconds
new Date(sec * 1000).toISOString(); // seconds to ISO
new Date(ms).toLocaleString("en-US", { hour12: false });
// Telling 13 digits apart: above 1e12 means milliseconds (second timestamps stay under 13 digits until 2286)
Python Converting between time and datetime
import time
from datetime import datetime, timezone
ts = int(time.time()) # 10-digit seconds
datetime.fromtimestamp(ts) # local time
datetime.fromtimestamp(ts, tz=timezone.utc) # UTC
datetime(2026, 9, 15, 12, 0).timestamp() # date to seconds
# Milliseconds: int(time.time() * 1000); to parse, divide by 1000 before passing it in
FAQ
How to tell a 10-digit from a 13-digit timestamp?
Count digits: 10 digits is seconds (like 1789056000, about Sep 2026), 13 digits is milliseconds (1789056000000). JavaScript's Date.now() and Java's System.currentTimeMillis() return milliseconds; Unix date +%s and MySQL UNIX_TIMESTAMP() return seconds. The tool auto-detects by digit count or accepts a manual choice.
What is the year-2038 problem?
Many old systems store second-level timestamps in 32-bit signed integers, whose maximum 2147483647 corresponds to 2038-01-19 03:14:07 UTC — the next second overflows to negative. Modern 64-bit systems are fine, but embedded devices and old database fields may be affected. This tool warns when a result exceeds the 32-bit range.
Do timestamps have a timezone?
A timestamp is an absolute instant with no timezone; the timezone only affects how it displays as a date and time. The same timestamp shows 01:46 in UTC and 09:46 in Beijing time. Converting a date to a timestamp needs a stated convention — this tool supports both UTC and local, and the 8-hour gap comes from that.
How is a Unix timestamp defined?
As "seconds elapsed since 1970-01-01 00:00:00 UTC," not counting leap seconds. Because it's based on UTC, the same instant has the same timestamp in any timezone; only displaying it as a local date needs the offset added.
How do I turn a timestamp into a readable date?
Multiply a second-level timestamp by 1000 for milliseconds, then use a date function: new Date(ms) in JavaScript, date('Y-m-d', ts) in PHP, datetime.fromtimestamp in Python. Distinguish seconds from milliseconds or you'll be off by 1000x.
Should a database store timestamps or datetimes?
By scenario: a timestamp is an integer, fast to compare and sort, unambiguous about timezone, good for exact instants; DATETIME / TIMESTAMP fields are readable and convenient for grouping by date. Most systems store a timestamp or UTC time and format by user timezone on display.
Why are some timestamps 16 or even 19 digits?
Different units: 10 digits is seconds, 13 milliseconds, 16 microseconds, 19 nanoseconds. JavaScript uses milliseconds (13 digits); some APIs return microseconds or nanoseconds. Identify by digit count, or test whether it exceeds 1e12 to detect millisecond level.