Using Date and Time Tools: Epoch, Time Zones, and Conversions

Convert Unix epoch timestamps and time zones correctly—seconds vs milliseconds, DST pitfalls, and scheduling examples.

Published 2025-03-01. From the Vastorae team.

What Unix time (epoch) represents

Unix time counts seconds since 1970-01-01T00:00:00Z—the Unix epoch—in UTC. Programmers, APIs, databases, and log systems favor it because a single integer sorts chronologically and does not depend on how a locale writes dates. Many JavaScript APIs use milliseconds since the epoch instead (1 second = 1,000 milliseconds).

Example: epoch `1_700_000_000` seconds is 2023-11-14T22:13:20Z. The same instant is a different wall-clock reading in Tokyo than in New York, but the epoch number does not change. That separation—absolute instant vs local display—is the core idea behind timestamp tools.

Store instants in UTC (or as epoch) and format for humans late. Mixing “naive” local timestamps without zone labels is a leading cause of off-by-one-day bugs around midnight and DST transitions.

Seconds vs milliseconds (and when numbers look “wrong”)

A 10-digit value near `1.7e9` is usually seconds. A 13-digit value near `1.7e12` is usually milliseconds. Feeding milliseconds into a converter that expects seconds produces dates centuries in the future; feeding seconds to a millisecond API produces dates in 1970. Magically “wrong” dates are often a units mismatch.

Worked check: `1_700_000_000_000` ms is the same instant as `1_700_000_000` s. If your log prints `1700000000` but your code multiplies by 1,000 again, you triple into nonsense. When debugging, print both the integer and an ISO-8601 UTC string from a trusted converter.

Time zones, offsets, and “the same moment”

A time zone civilly defines clocks for a region, including daylight-saving rules where applicable. An offset like UTC−05:00 is the numeric difference from UTC at a particular date—but the offset for “America/New_York” is not always −05:00 because DST may move it to −04:00 in summer.

Converting means answering: given a civil time in zone A, what civil time is it in zone B for the same instant? Example: 2025-06-15 09:00 in America/New_York (EDT, UTC−4) is 13:00 UTC and 22:00 in Asia/Tokyo the same calendar date. In winter, New York’s offset changes, so repeating the exercise in January yields different UTC math.

IANA names (`America/Chicago`, `Europe/Berlin`) beat fixed abbreviations (`CST`, `EST`) because abbreviations collide and omit DST rules. When scheduling, prefer zone IDs plus ISO-8601 timestamps with offsets over “3pm CST” in email.

DST pitfalls and nonexistent or ambiguous local times

When clocks spring forward, a local time such as 2:30 a.m. may not exist. When clocks fall back, 1:30 a.m. may occur twice. Schedulers that say “every day at 2:30 a.m. local” must define behavior for those nights—skip, shift, or use UTC anchors.

Airlines and distributed teams often publish departure times with explicit offsets or airport codes precisely to avoid ambiguity. If a meeting invite shows only local time without a zone, two participants can join an hour apart and both believe they were punctual.

Duration math vs calendar math

Epoch subtraction gives exact elapsed seconds between instants: arrive_epoch − depart_epoch. That is ideal for SLA timers and latency budgets. Calendar math (“add one month”) is different: January 31 plus one month may land on February 28/29 depending on the library’s rules.

Example: from 2024-01-31 to 2024-02-29 is a leap-year edge case; from 2024-03-31 plus one month may become 2024-04-30. When product requirements say “monthly,” spell out the rule. When they say “30 days,” use duration in hours/seconds from a UTC instant instead.

Practical workflows for developers and schedulers

Debugging API payloads: copy the raw epoch from JSON into an epoch converter, confirm UTC, then view your local zone. If the API docs promised date-only strings (`2025-07-04`) without times, do not invent a noon UTC assumption without reading the spec—date-only fields sometimes mean civil dates in a business time zone.

Scheduling across continents: pick a UTC instant, then display local times for each attendee. Example: a launch at 2025-09-01T15:00:00Z is 11:00 in New York (EDT) and 16:00 in London (BST) that day—verify with a zone converter near the date because DST rules change seasonally.

  • Prefer ISO-8601 with offset or `Z` for interchange
  • Label displays with IANA zone IDs in multi-region apps
  • Validate seconds vs milliseconds before trusting a UI date
  • Anchor recurring jobs to UTC when legal local time is ambiguous

Legacy formats and human parsing traps

Slash dates like `03/04/2025` mean 4 March in some locales and 3 April in others. Stick to `YYYY-MM-DD` for data exchange. Two-digit years and Excel serial dates add more conversion traps when migrating spreadsheets into code.

Relative phrases (“next Friday,” “in two weeks”) depend on the speaker’s local week-start and current zone. Turning them into epoch values requires a reference “now” and clear locale rules—something a simple epoch converter will not infer from English alone.

Tools to convert confidently

Use the Epoch Converter to move between Unix seconds or milliseconds and readable UTC/local displays. Use the Timezone Converter when you need the same instant expressed across regions for meetings or launches. Both run in the browser for quick checks while coding or planning.

For production systems, rely on well-maintained libraries that include the IANA time zone database updates. Browser tools help humans reason; libraries execute the rules repeatedly without copy-paste mistakes.

FAQ

Why do I get a different epoch than my friend?
Epoch measures an absolute UTC instant. If either of you typed a civil clock time without the same time zone selected, you encoded different instants. Agree on zone (or paste a `Z`-suffixed ISO string) before comparing integers. Also confirm both tools use seconds or both use milliseconds.
What about leap seconds?
POSIX-style Unix time as used by most applications smears or ignores leap seconds rather than exposing irregular minute lengths. For ordinary app development, standard epoch converters are appropriate. Specialized scientific time systems that track leap seconds need domain-specific libraries beyond a general web utility.
How can I tell seconds from milliseconds at a glance?
Count digits and magnitude. Values around 1–2 billion (about 10 digits) are typically seconds near the 2020s. Values around 1–2 trillion (13 digits) are typically milliseconds. Negative values refer to times before 1970. When unsure, convert both ways and see which ISO date looks plausible.
Why did my meeting invite skew by one hour after DST?
Fixed-offset assumptions go stale when a region starts or ends daylight saving. Recurring events stored as “15:00 with offset −05:00 forever” drift relative to local wall time. Store floating local time with a zone ID, or store UTC and re-format with up-to-date DST rules—depending on whether the event should follow civil clocks.
Is UTC the same as GMT?
In everyday software conversation they are often treated as equivalent references with offset zero. Strictly speaking, UTC is a civil time standard and GMT refers to a time zone/observatory tradition. For converting timestamps in apps, using UTC/`Z` is the clear choice; do not mix slang with ambiguous abbreviations like `BST` without a zone ID.
Can I compute age from two dates with epoch math alone?
Elapsed seconds between birth and now is straightforward, but legal “age in years” depends on calendar birthdays, time zones, and sometimes local law about the moment a day starts. Use calendar-aware age logic for birthdays; use epoch duration for stopwatches and SLAs.

Related tools

Browse Date & Time