Skip to content

millisecond

const millisecond: RegExp = /^[0-9]{1,9}$/;

Backward-compatible alias for fractionalSecond. Prefer fractionalSecond for new usage — the pattern matches 1–9 digits of fractional seconds, not just milliseconds.

import { millisecond } from "@northguild/gmt";
millisecond.test("123") // true
millisecond.test("123456789") // true (nanoseconds, despite the name)
millisecond.test("1234567890") // false (more than 9 digits)

regex/time.ts