Practical guides on Unix timestamps, JWT tokens, timezone handling and date conversion — for developers who work with real systems.
Almost every system stores time as a number somewhere: a created_at column, a log line, a cache TTL, the exp claim inside a login token. These guides explain how that number works and where it tends to go wrong, with code you can copy and check against the free tools on UnixLi.
The scope is deliberately narrow: Unix timestamps and epoch time; seconds versus milliseconds, the reason a date suddenly shows up as January 1970; JWT expiration and the exp, iat and nbf claims; timezones, UTC offsets and daylight saving time; Discord timestamp tags; and language guides for JavaScript, Python and PostgreSQL, plus tool pages for PHP, Go and Rust.
Articles are written by Hassan Ben. Most examples reuse the same reference value, 1715429912 (Saturday, May 11, 2024, 12:18:32 UTC), so you can paste it into the Unix Timestamp Converter and compare the output with the code.
Every method you need: Unix seconds vs milliseconds, Date conversion, Intl formatting, timezone handling, relative time, and TypeScript branded types. No library required.
Why your timestamp shows 1970, how to detect precision automatically, and the rules for every language and API you'll encounter.
Read the exp, iat, and nbf claims from any JWT token using pure JavaScript — no jsonwebtoken, no dependencies. With Python, PHP and Go examples.
Why time starts on January 1, 1970, how Unix timestamps work, famous epoch timestamps, the Year 2038 problem, and how to get the current epoch in every language.
Why fromtimestamp() lies to you, why utcfromtimestamp() is deprecated, and the correct patterns for timezone-aware datetimes. With zoneinfo, pytz, strftime, and pandas.
Why TIMESTAMP without timezone is a production bug, TO_TIMESTAMP(), EXTRACT(EPOCH), AT TIME ZONE, DATE_TRUNC, range query patterns, index tips, and schema best practices.
New to timestamps, or debugging a date that looks wrong? These four pages cover the basics most other problems build on.
Why time starts on January 1, 1970, how the count works, and the Year 2038 problem.
The digit rule: 10 digits means seconds, 13 means milliseconds, and how to detect it in code.
Turn seconds, milliseconds or microseconds into UTC and local dates, and ISO 8601 dates back into Unix time.
Read exp, iat and nbf without a library. All three are Unix seconds, as RFC 7519 requires.
Each tool runs entirely in your browser, so nothing you paste is sent to a server. Use them alongside the articles to check your own values.
Decode a token payload and see exp, iat and nbf as readable dates. Inspection only, no signature check.
See one Unix timestamp across 13 timezones with DST-aware offsets, or watch a live world clock.
Build <t:unix:style> tags for every style flag, from short time to relative “2 years ago”.
Exact duration between two moments in seconds, hours, days and business days.
Language guides. JavaScript: the complete conversion guide and the JavaScript timestamp tool. Python: datetime and the UTC trap and the Python timestamp tool. SQL: PostgreSQL TIMESTAMPTZ vs TIMESTAMP. Tool pages with ready-to-copy snippets also exist for PHP, Go and Rust.
Count the digits. For dates between 2001 and 2286, a 10-digit value is Unix seconds and a 13-digit value is milliseconds. 16 digits usually means microseconds and 19 digits nanoseconds. The Unix Timestamp Converter detects the precision automatically.
Almost always because a value in seconds was passed to something that expects milliseconds. In JavaScript, new Date(1715429912) returns January 20, 1970, while new Date(1715429912 * 1000) returns May 11, 2024. Multiply seconds by 1000 before creating the Date. The seconds vs milliseconds guide covers every major language.
Unix seconds. RFC 7519 defines exp, iat and nbf as NumericDate values, which count seconds since 1970-01-01 UTC. Compare exp against Math.floor(Date.now() / 1000), not Date.now(). The JWT Decoder shows all three as readable dates.
No. A Unix timestamp counts seconds since 1970-01-01 00:00:00 UTC and is the same everywhere. The timezone only matters when you format it for display: 1715429912 is 12:18:32 in UTC, 14:18:32 in Paris and 08:18:32 in New York. Try it in the Timezone Converter.