ContextCleaner: see every entry in the Windows 11 right-click menu, and which app added it — on the Microsoft Store.
Engineering PrismKit

Unix Timestamp in Seconds or Milliseconds? Why Your Date Shows 1970 (or the Year 55840)

Published October 21, 2026 Updated October 21, 2026 8 min read

If a timestamp turns into a date in January 1970, you passed seconds to something that expected milliseconds. If it turns into a year like 55840, or throws an out-of-range error, you passed milliseconds to something that expected seconds. Count the digits: a current Unix time in seconds has 10 digits, and in milliseconds it has 13. PrismKit, a free Windows utility belt from Automata Labs, includes an epoch timestamp converter in its free core tools, so you can check a value offline from a hotkey instead of pasting it into a website.

This guide shows how to tell the two apart, what each language expects, and the conversions that get it right.

Convert epoch timestamps offline from a hotkey, with 36 developer tools in one palette.

Get it from Microsoft

What is a Unix timestamp?

A Unix timestamp counts time from the epoch, 00:00:00 UTC on 1 January 1970. POSIX defines it in Seconds Since the Epoch as a count of seconds, with each day counted as exactly 86,400 seconds. Leap seconds are not counted.

Many systems, though, count in milliseconds. JavaScript is the best-known example: MDN’s Date reference describes a Date as a timestamp in milliseconds since the epoch, and Date.now() returns milliseconds. So the same instant has two common spellings, a factor of 1,000 apart, and nothing in the number itself says which one it is.

How do you tell seconds from milliseconds?

Count the digits. At the time of writing, in October 2026, the Unix time in seconds is about 1,792,000,000: ten digits. In milliseconds it is about 1,792,000,000,000: thirteen digits.

DigitsMost likely unitExampleConverts to
10Seconds170000000014 November 2023, 22:13:20 UTC
13Milliseconds170000000000014 November 2023, 22:13:20 UTC
16Microseconds1700000000000000Same instant
19Nanoseconds1700000000000000000Same instant

Ten digits in seconds covers every date from September 2001 to November 2286, so for current data the digit count is a reliable guide. It breaks down for old dates: a timestamp in seconds from the 1990s has nine digits. When you are unsure, convert the value both ways and pick the result that makes sense for the data.

Why does my date show 1970?

You gave a seconds value to something that expects milliseconds. The value is read as 1,000 times too small, which lands a few weeks after the epoch. We ran this in Node.js 20:

new Date(1700000000).toISOString()
// '1970-01-20T16:13:20.000Z'

new Date(1700000000 * 1000).toISOString()
// '2023-11-14T22:13:20.000Z'

A date in January 1970 almost always means this mistake. A date of exactly 1 January 1970 00:00:00 usually means something else: the value was zero, null or empty and was converted anyway.

Why does my date show the year 55840, or throw an error?

You gave a milliseconds value to something that expects seconds. The value is read as 1,000 times too large, which lands tens of thousands of years in the future, past what most date types can hold.

In Python 3.13 on Linux, we got:

>>> from datetime import datetime, timezone
>>> datetime.fromtimestamp(1700000000000, tz=timezone.utc)
ValueError: year 55840 is out of range

The Python datetime documentation says fromtimestamp() takes a POSIX timestamp in seconds, and that it can raise OverflowError or OSError when the value is out of the range the platform supports, so the exact error can differ by system.

In PowerShell 7, [DateTimeOffset]::FromUnixTimeSeconds(1700000000000) throws an error saying valid values are between -62135596800 and 253402300799, which are the seconds from year 1 to the end of year 9999.

Check a timestamp in seconds before it goes into a query, a log filter or a ticket.

Get it from Microsoft

What unit does each language expect?

EnvironmentCallUnitGets you the current time in
JavaScriptnew Date(n)MillisecondsDate.now(), milliseconds
Pythondatetime.fromtimestamp(n, tz=timezone.utc)Seconds (float allowed)time.time(), seconds
.NETDateTimeOffset.FromUnixTimeSeconds(n)SecondsToUnixTimeSeconds()
.NETDateTimeOffset.FromUnixTimeMilliseconds(n)MillisecondsToUnixTimeMilliseconds()
PowerShell 7Get-Date -UnixTimeSeconds n -AsUTCSecondsGet-Date -UFormat %s
Excel=A2/86400+DATE(1970,1,1)SecondsNot built in

.NET makes the unit part of the method name. Microsoft’s reference for DateTimeOffset.FromUnixTimeMilliseconds describes the input as the number of milliseconds since 1970-01-01T00:00:00Z. That naming is a good habit to copy in your own code and column names: created_at_ms says what created_at does not.

How do you convert correctly?

JavaScript, seconds to Date:

const d = new Date(seconds * 1000);

Python, milliseconds to datetime:

from datetime import datetime, timezone
d = datetime.fromtimestamp(ms / 1000, tz=timezone.utc)

Pass tz=timezone.utc unless you want local time. Without it, Python converts to the machine’s local time zone, which is a common source of off-by-hours bugs.

PowerShell, seconds to a date:

Get-Date -UnixTimeSeconds 1700000000 -AsUTC
[DateTimeOffset]::FromUnixTimeMilliseconds(1700000000000).UtcDateTime

Without -AsUTC, Get-Date shows the result in your local time zone. We checked both lines in PowerShell 7.4; each prints 14 November 2023 22:13:20.

Excel, seconds in A2 to a date:

=A2/86400+DATE(1970,1,1)

Format the cell as a date and time. The result is in UTC. For milliseconds, divide by 86,400,000 instead.

What about the year 2038?

A signed 32-bit integer holds a maximum of 2,147,483,647 seconds, which is 19 January 2038 at 03:14:07 UTC. Systems that still store seconds in 32 bits will overflow there. It is a separate problem from the seconds-versus-milliseconds mix-up, and a milliseconds value will not fit in a 32-bit field at all: today’s 13-digit values are hundreds of times larger than the maximum. Store timestamps in 64-bit integers either way.

How does PrismKit help?

PrismKit is a keyboard-first, local-only utility belt for Windows. According to its Microsoft Store listing, its core tools are free forever and include converters for epoch timestamps, alongside JSON, XML, SQL and HTML formatters, Base64, URL and JWT decoding, UUID and hash generators, and regex testing: 36 tools in all, opened from a hotkey and a command palette.

It is 100% offline, so a timestamp from a production log, or the JWT it came from, never leaves your PC. Optional one-time add-on packs unlock more tools; the epoch converter is in the free core. Our page on timestamp and UUID generators in one and our local JSON formatter and minifier guide cover other tools in the same palette.

Use the digit check from this guide first, then confirm the conversion in PrismKit before the value goes anywhere that matters. A typical case: a support ticket quotes 1792584686000 from a browser log, and the database column holds seconds. Ten seconds with the digit count and the converter tells you to divide by 1,000 before you filter, instead of running a query that silently returns nothing because every row is before the year 55840.

Frequently asked questions

Is a Unix timestamp always UTC?

The count itself has no time zone: it is seconds since a fixed instant defined in UTC. The time zone only appears when you turn it into a local date.

Why does my JWT exp claim have 10 digits?

RFC 7519, the JWT standard, defines time claims such as exp and iat as NumericDate values: seconds since the epoch, not milliseconds. Comparing them with Date.now() in JavaScript without dividing by 1,000 is a common bug.

Can a timestamp be negative?

Yes. Negative values are dates before 1970. Not every function accepts them on every platform.

Does PrismKit detect the unit automatically?

Do not rely on any converter guessing for you. Check the converted date against what you expect, and the safest habit is to know your source’s unit and name your fields with it.

Try PrismKit

PrismKit is free in the Microsoft Store, with optional one-time add-on packs. More detail is on the PrismKit product page.

Keep a timestamp converter, JWT decoder and JSON formatter one hotkey away, offline.

Get it from Microsoft

Windows, Excel and PowerShell are trademarks of the Microsoft group of companies.

Last updated 21 October 2026. Published by Automata Labs, a software company in Canada.

// release_radar

Get notified about new releases.

We build native, local-first tools for professionals who refuse SaaS fatigue. Drop your email to hear about new apps, major updates, and zero-telemetry releases as they land on the Microsoft Store. No spam — just release news.