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-ModifiedandExpiresheaders 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.
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.