import { Exception } from '@/data-helpers/Exception'; import { Serializable } from '@/data-helpers'; export interface Duration { years?: number; months?: number; days?: number; quarters?: number; weeks?: number; hours?: number; minutes?: number; seconds?: number; } export declare class DateTime implements Serializable { private static readonly DAYS_OF_WEEK; private static readonly MONTHS; private readonly value; private constructor(); /** * Get a DateTime instance created at the current moment of calling the method */ static now(): DateTime; /** * Get a DateTime instance with a given timestamp * * @param milliseconds the javascript timestamp */ static fromTimestamp(milliseconds: number): DateTime; /** * Get a DateTime instance created with a given ISO formatted string * * @param isoString The ISO formatted date time string */ static fromISOString(isoString: string): DateTime; /** * Get a DateTime instance created with a given date time string and a given format * * We follow the formatting as presented by Moment or Luxon. * https://moment.github.io/luxon/#/parsing?id=table-of-tokens * * @param datetime The date time string * @param format The format of the given date time string */ static from(datetime: string, format: string): DateTime; /** * Add the given duration to the DateTime and return a new DateTime * * @param duration the duration to be added */ add(duration: Duration): DateTime; /** * Subtract the given duration to the DateTime and return a new DateTime * * @param duration the duration to be subtracted */ subtract(duration: Duration): DateTime; /** * Get the DateTime as ISO formatted string * * Format: yyyy-MM-ddTHH:mm:ss.SSSZ * Example: 2022-06-24T20:10:41.193Z */ toISOString(): string; /** * Get the DateTime as a Locale formatted string * * Format: dd/m/yyyy hh:mm:ss a * Example: 24/6/2022, 10:10:41 pm */ toLocaleString(): string; /** * Get the DateTime as an UTC formatted string * * Format: EEE, dd MMM yyyy HH:mm:ss GMT * Example: Fri, 24 Jun 2022 20:10:41 GMT */ toUTCString(): string; /** * Get the DateTime as an RFC2822 formatted string * * Format: EEE, dd MMM yyyy HH:mm:ss +0000 * Example: Fri, 24 Jun 2022 20:10:41 +0000 */ toRFC2822(): string; /** * Get the DateTime as a javascript date toString formatted string * * Example: Fri Jun 24 2022 22:10:41 GMT+0200 (Central European Summer Time) */ toString(): string; /** * Get the DateTime as a javascript timestamp */ timestamp(): number; toJSON(): object; private doMath; } export declare class InvalidDateTimeException extends Exception { constructor(message?: string); }