mirror of
https://github.com/planetrenox/ortus.git
synced 2026-10-29 04:34:53 +00:00
PRT (Planet Renox Time): ms since 1998-03-14T03:00:00Z
Zero-dependency ESM package with types. now, fromDate, toDate, fromUnixMs, toUnixMs; units ms|s|m|h|d|w, floored toward -Infinity, exact across the full JS Date range. 0BSD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
/** PRT units: milliseconds (official), seconds, minutes, hours, days, weeks */
|
||||
export type Unit = 'ms' | 's' | 'm' | 'h' | 'd' | 'w'
|
||||
|
||||
export declare const PRT: Readonly<{
|
||||
/** Current PRT, rounded down. Defaults to ms. */
|
||||
now(unit?: Unit): number
|
||||
/** PRT at the given Date, rounded down. Defaults to ms. */
|
||||
fromDate(date: Date, unit?: Unit): number
|
||||
/** Date at the given integer PRT value. Defaults to ms. */
|
||||
toDate(value: number, unit?: Unit): Date
|
||||
/** PRT at the given integer Unix ms, rounded down. Defaults to ms. */
|
||||
fromUnixMs(unixMs: number, unit?: Unit): number
|
||||
/** Unix ms at the given integer PRT value. Defaults to ms. */
|
||||
toUnixMs(value: number, unit?: Unit): number
|
||||
}>
|
||||
|
||||
export default PRT
|
||||
Reference in New Issue
Block a user