Skip to main content
DEVELOPER

Unix Timestamp Validator

Check whether a value is a valid Unix timestamp and see exactly why, if it is not.

What counts as a valid Unix timestamp

A valid Unix timestamp is a whole number (an optional decimal fraction is also accepted) that, once interpreted as seconds or milliseconds, falls within the supported calendar range of the years 1 to 9999. This tool checks the format first, then the range, and tells you which check failed instead of a generic error.

Why validation catches real bugs

The most common mistake is mixing up seconds and milliseconds, which does not always cause an obvious crash; it can silently produce a date decades in the wrong direction. This tool flags that case directly, so a value that is technically valid but suspicious (for example, a 13-digit value forced into a seconds field) is called out in the notes.

Want the background? Read our comprehensive guide: Seconds vs Milliseconds Timestamps.

How to use this tool

  1. Enter the value you want to check.
  2. Choose the unit, or leave it on Auto to have it detected.
  3. Select Validate.
  4. Read the Valid or Invalid result, the reason if it is invalid, and any notes about the value.

Examples

A valid value and an invalid one, with the exact reason shown for each.

A valid timestamp

1790000000 (seconds)

Result
Valid Unix timestamp in seconds.

Not a number

hello world

Result
"hello world" is not a Unix timestamp. A timestamp contains only digits, with an optional minus sign and an optional decimal point.

A negative timestamp

-86400 (seconds)

Result
Valid Unix timestamp in seconds.

Frequently Asked Questions

What makes a timestamp invalid?
Text that is not a number, a value with more digits than any real Unix timestamp unit uses, or a number that falls outside the supported calendar range (years 1 to 9999) once interpreted in the chosen unit.
Can negative numbers be valid?
Yes. Negative Unix timestamps represent moments before 1 January 1970 and are valid as long as they are within the supported range.
How does the validator choose seconds or milliseconds?
On Auto, values with 12 or more digits are treated as milliseconds and shorter values as seconds, the same rule the other Castov converters use. You can force a specific unit instead.
Does this check leap seconds?
No. Unix time does not count leap seconds, so this validator (like the rest of Castov) treats every day as exactly 86,400 seconds.