import * as moment from 'moment'; /** * Conversion from .NET Ticks to millseconds * NOTE: this means all moment values have millisecond precision */ export declare const TicksPerMillisecond = 10000; export declare const MillisecondsPerDay = 86400000; export declare const MillisecondsPerYear = 31536000000; /** * Offset from .NET milliseconds to unix milliseconds */ export declare const EpochOffset = 62135596800000; /** * Parse format for the default string serialization of a .NET DateTime */ export declare const DefaultDateTimeFormat = "YYYY-MM-DD hh:mm:ss A"; /** * Parse format for the default string serialization of a .NET DateTimeOffset */ export declare const DefaultDateTimeOffsetFormat: string; /** * Converts between .NET DateTime.Ticks and moment values */ export declare class DateTime { /** * Converts a .NET DateTime string to a moment value * i.e. "2016-03-09 4:32:32 PM" or "2016-03-09 4:32:32 PM -08:00" (default formats) */ static fromString(value: string, ...formats: string[]): moment.Moment; static fromString(value: string | undefined, ...formats: string[]): moment.Moment | undefined; /** * Converts a .NET DateTime.Ticks value to a moment value (and optionally sets the UTC offset) * NOTE: if no offset is provided, UTC is assumed */ static fromNumber(value: number, offset?: number | string): moment.Moment; static fromNumber(value: number | undefined, offset?: number | string): moment.Moment | undefined; /** * Converts a moment value to a DateTime.Ticks */ static toNumber(value: moment.Moment): number; static toNumber(value: moment.Moment | undefined): number | undefined; static DefaultLongFormat: string; static DefaultShortFormat: string; /** * Standardized string representation of a moment */ static format(value: moment.Moment | undefined, format?: string, defaultValue?: any): any; static formatLong(value: moment.Moment | undefined, defaultValue?: any): any; static formatShort(value: moment.Moment | undefined, defaultValue?: any): any; } /** * Converts between .NET TimeSpan.Ticks and moment values */ export declare class TimeSpan { /** * Converts a .NET TimeSpan string to a moment duration * i.e. "1.05:37:46.6660000" (1.23456789 days) */ static fromString(value: string): moment.Duration; static fromString(value: string | undefined): moment.Duration | undefined; /** * Converts a .NET TimeSpan.Ticks value to a moment duration */ static fromNumber(value: number): moment.Duration; static fromNumber(value: number | undefined): moment.Duration | undefined; /** * Converts a moment duration a .NET TimeSpan.Ticks amount */ static toNumber(value: moment.Duration): number; static toNumber(value: moment.Duration | undefined): number | undefined; static DefaultDurationHoursPrecision: number; static DefaultDurationDaysPrecision: number; static DefaultFormatMaxHours: number; /** * Standardized hours string representation of a duration */ static formatHours(value: moment.Duration | undefined, precision?: number, defaultValue?: any): any; /** * Standardized days string representation of a duration */ static formatDays(value: moment.Duration | undefined, defaultValue?: any): any; /** * Standardized duration string representation that will format hours or days based on maxHours */ static format(value: moment.Duration | undefined, maxHours?: number, precision?: number, defaultValue?: any): any; }