Skip to content
faker.tools
All 79

Plate VIII · Localization, Edge Cases & Data Sanitizers

Timezone & Timestamp Generator

Seven formats, eighteen timezones, and the DST edges.

#Timestamp
12026-10-22T15:10:40Z
22026-10-24T04:09:31Z
32026-10-23T00:19:01Z
42026-10-24T10:30:50Z
52026-10-22T23:37:28Z
62026-10-20T00:58:16Z
72026-10-21T08:42:48Z
82026-10-23T02:29:41Z
92026-10-19T22:35:38Z
102026-10-22T15:19:05Z
10 rows · 209 BGenerated in your browser · Timezone & Timestamp Generator

Unix seconds and milliseconds differ by a factor of a thousand, and code that confuses them puts a date in 1970 or in the year 56000. Generating both, alongside the ISO form, makes the mistake obvious the moment it happens.

What you can control

  • Seven formats, including the HTTP date form that Last-Modified and Expires headers require.
  • The DST-edge range concentrates timestamps around a transition, where hours repeat or vanish.
  • Eighteen timezones with correct offsets, including the half-hour ones that break naive arithmetic.
  • Ordered mode returns an ascending sequence for building a time series.

Testing ideas

  • DST transitions. Use the DST range to test scheduling and duration calculations across clock changes.
  • Formats. Generate Unix seconds and milliseconds together to catch the 1000× mix-up.
  • Time zones. Compare UTC with Asia/Kolkata (+05:30) to test zones with non-hour offsets.
  • Relative times. "3 hours ago" output tests relative-time formatting.

What this is not

Timezone conversion uses the runtime's Intl implementation, which depends on its ICU data. A stale ICU build can carry outdated DST rules for regions that changed them recently.

Questions

Seconds or milliseconds?

Unix time is defined in seconds. JavaScript's `Date.now()` returns milliseconds. Mixing them is the single most common timestamp bug there is.

Why test around DST transitions?

Because in spring an hour does not exist and in autumn an hour happens twice. Any code that adds 24 hours instead of one day gets both wrong.

What is the HTTP date format?

The fixed `Sun, 06 Nov 1994 08:49:37 GMT` form required by RFC 7231 for headers like `Last-Modified`. It is always in GMT and always in English, regardless of locale.

Next in Edge cases

All 7 →