Skip to content
19 10240119 Tools

answer

How to Convert Timestamp to Date

Convert Unix timestamps to readable UTC and local dates with seconds, milliseconds, examples, limits, and timezone mistakes explained.

Updated 2026-05-16

Direct Answer

Convert a Unix timestamp by counting from 1970-01-01 00:00:00 UTC, then displaying the result in UTC or your local time zone. The main decision is whether the input is seconds or milliseconds. Current second timestamps are usually 10 digits, while current millisecond timestamps are usually 13 digits.

Step-by-Step Conversion

Start by identifying the unit, because using milliseconds as seconds can push the result thousands of years into the future. After the unit is clear, convert the value to milliseconds if needed and format the date.

  • Trim spaces and confirm the value is numeric
  • Treat 10-digit modern values as seconds unless your source says otherwise
  • Treat 13-digit modern values as milliseconds
  • Format UTC first so you have a stable reference
  • Then compare local time if the user-facing date depends on location

Example

The same moment can be written as seconds or milliseconds. Both examples below point to the same UTC instant.

Seconds: 1715731200
Milliseconds: 1715731200000
UTC result: 2024-05-15T00:00:00.000Z

Limits

A timestamp is an exact moment, not a calendar-only date. Local display can change by time zone, daylight-saving rules, and the viewer location. If your task is planning a due date or counting days, a date calculator may be safer than timestamp math.

  • Do not remove zeros from millisecond timestamps
  • Do not compare local dates without naming the time zone
  • Do not use Unix timestamps for historical calendar rules unless your system explicitly supports them

Common Mistakes

The most common mistake is converting a millisecond value as if it were seconds. Another is saying the result is wrong when UTC and local time are simply different displays of the same instant. Keep both outputs visible when debugging logs, API data, or scheduled jobs.

FAQ

How do I know if a timestamp is seconds or milliseconds?

For current dates, second timestamps are usually 10 digits and millisecond timestamps are usually 13 digits. If the source system documents the unit, trust that over digit guessing.

Why is my converted date off by hours?

You may be comparing UTC with your local time zone. The instant can be correct while the displayed clock time changes by location and daylight-saving rules.

Why did my date become far in the future?

That often happens when a millisecond timestamp is treated as seconds. Choose milliseconds manually or divide the value by 1000 before converting as seconds.

Is a timestamp the same as a calendar date?

No. A timestamp is an exact moment. A calendar date is a date-only value that can depend on time zone, business rules, and whether time of day matters.