timestampinfo.fr
Tools & documentation

TIME DOCUMENTATION

Understanding Unix timestamps and the Epoch

Origin, units, conversion and comparison: the basics of handling an instant correctly.

What a timestamp represents

A timestamp identifies a date and time according to a convention. Unix time counts seconds since January 1, 1970 at 00:00:00 UTC, excluding leap seconds. Values before this origin are negative.

0           → 1970-01-01T00:00:00Z
-1          → 1969-12-31T23:59:59Z
1711972800  → 2024-04-01T12:00:00Z

Get the current timestamp

JavaScript provides Date.now() in milliseconds. PHP provides time() in seconds. Python provides time.time() in seconds with a fraction. A number must always be accompanied by its unit convention.

An instant has no single display time zone

The same timestamp displays different times depending on the selected time zone. Changing the display time zone does not change the instant. Conversely, interpreting local time without knowing its time zone can produce the wrong instant.

Compare and calculate

A numerical comparison only makes sense if both values share the same origin and unit. For a duration, subtract the start from the end. Divide a difference in seconds by 3,600 to get hours; do not confuse this duration with a time of day.

Calculate a timestamp difference

Convert milliseconds to seconds

Divide milliseconds by 1,000. Keeping the fraction preserves precision: 1711972800123 ms becomes 1711972800.123 s. Rounding or truncating to an integer removes the fraction; division alone does not.

Get a file timestamp

In Python, os.stat(path).st_mtime gives the modification timestamp in seconds. Convert it with datetime.fromtimestamp(value, timezone.utc) to obtain UTC. This is the file modification time, not proof of creation or authenticity.

A timestamp is neither proof nor a unique identifier

Two events may share the same value, and clocks may be adjusted. A timestamp alone guarantees neither causal order, authenticity nor event uniqueness. Signature systems and certified timestamping address different requirements.

References

Reference documentation

Open the converter

English version published September 26, 2026.