export declare class DateTool { date: Date; protected constructor(date?: Date); /** * - DD-MM-YYYYY (HH:mm)? * - DD.MM.YYYYY (HH:mm)? * - ISODate * - Ticks */ static with(mix: string | number | Date): DateTool; static withNow(): DateTool; clone(): DateTool; add(x: string | number): this; dayStart(): this; dayEnd(): this; weekStart(): this; weekEnd(): this; monthStart(): this; monthEnd(): this; daysBetween(b: Date): number; /** e.g. yyyy-MM-dd HH:mm */ format(format: string): string; setMilliseconds(v: number): this; setSeconds(v: number): this; setMinutes(v: number): this; setHours(h: number, min?: number, sec?: number, ms?: number): this; /** Sets the numeric day-of-the-month value of the Date object using local time. */ setDate(v: number): this; setMonth(v: number): this; setFullYear(v: number): this; nextDay(h?: number, min?: number, s?: number, ms?: number): this; toUnixTimestamp(): number; } declare class Timer { private name?; private paused; private from; private pausedAt; constructor(name?: string); log(msg?: string): this; pause(): this; resume(): this; restart(name?: string): this; } export declare namespace $date { function tool(dateStr: string): DateTool; function tool(date: Date): DateTool; function tool(): DateTool; function timer(name?: string): Timer; /** e.g. yyyy-MM-dd HH:mm */ function format(date: number | string | Date, format: string): string; function formatTimespan(ms: number): string; function dayStart(date?: Date): Date; function hourStart(date?: Date): Date; function dayEnd(date?: Date): Date; function weekStart(date?: Date): Date; function weekEnd(date?: Date): Date; function weekNumber(date?: Date): number; function monthStart(date?: Date): Date; function monthEnd(date?: Date): Date; /** date1 + X === date2 */ function daysBetween(a: Date, b: Date, abs?: boolean): number; /** hour1 + X === hour2 */ function hoursBetween(a: Date, b: Date, abs?: boolean): number; function minsBetween(a: Date | string, b: Date | string, abs?: boolean): number; /** * - DD-MM-YYYYY (HH:mm)? * - DD.MM.YYYYY (HH:mm)? * - ISODate * - Ticks */ function parse(mix: Date | number | string, default_?: Date): Date; /** * s|sec|seconds|m|mins?|h|hours?|d|days?|w|weeks?|months?|y|years? * e.g: 2h * @param str * @param opts Default: ms */ function parseTimespan(str: string, opts?: { get?: 'ms' | 's'; anchor?: Date; }): number; function additive(date: Date | number | string, x: string | number): Date; function equal(a: Date, b: Date, precision?: 'year' | 'month' | 'date' | 'hour' | 'minute' | 'second' | 'ms'): boolean; function isSameDay(a: Date, b: Date): boolean; function toUnixTimestamp(date?: Date): number; function fromUnixTimestamp(seconds: number | bigint): Date; } export {};