getUnixNow
Signature
Section titled “Signature”getUnixNow(options?: { epochUnit?: UnixUnit; }): numbergetUnixNow(options?: unknown): number | nullReturn the current Unix timestamp in either seconds or milliseconds.
- Uses Temporal.Now.instant() to get current time.
- An explicit
undefinedis the same as omitted. Options outside the type, an unknownepochUnitor a non-object such as a bare"seconds", return null. - Options whose
epochUnitthrows when read, such as a getter or aProxy, also return null.
Options
Section titled “Options”options
optional: the unit of the result
| Option | Type | Default | Description |
|---|---|---|---|
epochUnit? | "seconds" | "milliseconds" | "second" | "millisecond" (UnixUnit) | "milliseconds" | The unit of the returned epoch: "seconds" or "milliseconds", singular or plural. Seconds floor toward −∞, as POSIX time_t counts whole elapsed seconds. Any other value is outside the type and returns null. |
Returns
Section titled “Returns”the current Unix timestamp; null for options outside the type or options that throw when read
Related types
Section titled “Related types”Examples
Section titled “Examples”import { getUnixNow } from "@northguild/gmt/unix/get";
getUnixNow() // 1700000000000Source
Section titled “Source”Accessibility
© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.