import { TimeZone } from "../imports/TimeZone"; import { GlideTime } from "./GlideTime"; import { GlideCounter } from "./GlideCounter"; import { GlideDate } from "./GlideDate"; import { GlideDuration } from "./GlideDuration"; /** * The scoped GlideDateTime default constructor, instantiates a new GlideDateTime object with the current date and time * in Greenwich Mean Time (GMT). Optional 'value' parameter with a date and time val... */ export declare class GlideDateTime { /** * Adds a GlideTime object to the current GlideDateTime object */ add(gd: GlideTime): void; add(value: number): void; addDays(amount: number): void; /** * Adds a specified number of days to the current GlideDateTime object, expressed in the user's timezone */ addDaysLocalTime(amount: number): void; /** * Adds a specified number of days to the current GlideDateTime object, expressed in the UTC time zone */ addDaysUTC(amount: number): void; addMonths(amount: number): void; /** * Adds a specified number of months to the current GlideDateTime object, expressed in the user's time zone */ addMonthsLocalTime(amount: number): void; /** * Adds a specified number of months to the current GlideDateTime object, expressed in the UTC time zone */ addMonthsUTC(amount: number): void; /** * Adds a specified number of seconds to the current GlideDateTime object */ addSeconds(value: number): void; addWeeks(amount: number): void; /** * Adds a specified number of weeks to the current GlideDateTime object, expressed in the user's timezone */ addWeeksLocalTime(amount: number): void; /** * Adds a specified number of weeks to the current GlideDateTime object, expressed in the UTC time zone */ addWeeksUTC(amount: number): void; addYears(amount: number): void; /** * Adds a specified number of years to the current GlideDateTime object, expressed in the user's time zone */ addYearsLocalTime(amount: number): void; /** * Adds a specified number of years to the current GlideDateTime object, expressed in the UTC time zone */ addYearsUTC(amount: number): void; /** * Returns true if the object's data time is after the input argument */ after(gdt: GlideDateTime): boolean; /** * Returns true if the object's data time is before the input argument */ before(gdt: GlideDateTime): boolean; /** * Compares two GlideDateTime objects */ compareTo(o: any): number; constructor(); constructor(date: Date); constructor(g: GlideDateTime); constructor(value: string); constructor(value: string, isDisplayValue: boolean); equals(o: any): boolean; static excludeZFromFormat(format: string): string; getCalendarInTimeZone(timeZone: string): any; getCounter(): GlideCounter; /** * Gets the amount of time that daylight savings time is offset */ getDSTOffset(): number; /** * Gets the date in the system time zone */ getDate(): GlideDate; getDayOfMonth(): number; /** * Gets the day of the month stored by the GlideDateTime object, expressed in the current user's time zone */ getDayOfMonthLocalTime(): number; /** * Gets the day of the month stored by the GlideDateTime object, expressed in the UTC time zone */ getDayOfMonthUTC(): number; getDayOfWeek(): number; /** * Gets the day of the week stored by the GlideDateTime object, expressed in the user's time zone */ getDayOfWeekLocalTime(): number; /** * Gets the day of the week stored by the GlideDateTime object, expressed in the UTC time zone */ getDayOfWeekUTC(): number; getDaysInMonth(): number; /** * Sets the day of the month to a specified value in the user's time zone */ getDaysInMonthLocalTime(): number; /** * Gets the number of days in the month stored by the GlideDateTime object, expressed in the UTC time zone */ getDaysInMonthUTC(): number; /** * Gets the datetime in the current user's display format and time zone */ getDisplayValue(): string; /** * Gets the display value in the internal datetime format */ getDisplayValueInternal(): string; getDisplayValueLang(style: string): string; getDisplayValueLang(style: string, language: string): string; getDisplayValueWithoutTZ(): string; /** * Gets the current error message */ getErrorMsg(): string; /** * Returns local time with internal time format */ getInternalFormattedLocalTime(): string; getInternalMidnight(iday: number): GlideDateTime; /** * Gets the date for the user's time zone */ getLocalDate(): GlideDate; /** * Returns a GlideTime object that represents the time portion of the GlideDateTime object in the user's time zone */ getLocalTime(): GlideTime; getMonth(): number; /** * Gets the month stored by the GlideDateTime object, expressed in the current user's time zone */ getMonthLocalTime(): number; /** * Gets the month stored by the GlideDateTime object, expressed in the UTC time zone */ getMonthUTC(): number; /** * Gets the number of milliseconds since January 1, 1970, 00:00:00 Greenwich Mean Time (GMT) */ getNumericValue(): number; getRaw(): Date; getSpanTime(dayofweek: number): GlideTime; getTZOffset(): number; /** * Returns a GlideTime object that represents the time portion of the GlideDateTime object */ getTime(): GlideTime; getUTCMidnight(dayofweek: number): GlideDateTime; getUTCValue(): string; /** * Returns local time with user time format */ getUserFormattedLocalTime(): string; getUserTimeZone(): TimeZone; /** * Gets a datetiime value in the same format as it is stored in the database */ getValue(): string; /** * Gets the number of the week stored by the GlideDateTime object, expressed in the user's time zone */ getWeekOfYearLocalTime(): number; /** * Gets the number of the current week of the current year */ getWeekOfYearUTC(): number; getXMLValue(): string; getYear(): number; /** * Gets the year stored by the GlideDateTime object, expressed in the current user's time zone */ getYearLocalTime(): number; /** * Gets the year stored by the GlideDateTime object, expressed in the UTC time zone */ getYearUTC(): number; /** * Determines if an object's date is set */ hasDate(): boolean; hashCode(): number; /** * Determines if an object's time uses a daylight savings offset */ isDST(): boolean; /** * Determines if a value is a valid datetime */ isValid(): boolean; /** * Returns true if the object's data time is on or after the input argument */ onOrAfter(gdt: GlideDateTime): boolean; /** * Returns true if the object's data time is on or before the input argument */ onOrBefore(gdt: GlideDateTime): boolean; setDayOfMonth(day: number): void; /** * Sets the day of the month to a specified value in the local time zone */ setDayOfMonthLocalTime(day: number): void; /** * Sets the day of the month to a specified value in the UTC time zone */ setDayOfMonthUTC(day: number): void; setDebugTZ(debugTZ: TimeZone): void; /** * Sets a date and time value using the current user's display format and time zone. Also set an optional parameter * 'format', to set date and time format */ setDisplayValue(asDisplayed: string): void; setDisplayValue(value: string, format: string): void; /** * Sets a date and time value using the internal format and the current user's time zone */ setDisplayValueInternal(value: string): void; setDisplayValueInternalWithAlternates(value: string): void; setDisplayValueLang(asDisplayed: string, style: string): void; setDisplayValueLang( asDisplayed: string, style: string, language: string ): void; /** * Sets the date and time of the current object using an existing GlideDateTime object. This method is equivalent to * instantiating a new object with a GlideDateTime parameter */ setGlideDateTime(g: GlideDateTime): void; setInitialValue(value: string): void; setMonth(month: number): void; /** * Sets the month stored by the GlideDateTime object to a specified value using the current user's time zone */ setMonthLocalTime(month: number): void; /** * Sets the month stored by the GlideDateTime object to a specified value using the UTC time zone */ setMonthUTC(month: number): void; setNumericValue(l: number): void; setTZ(tz: TimeZone): void; setTimeZone(timeZoneAsString: string): boolean; setValue(o: any): void; /** * Sets the date and time */ setValue(number: number): void; /** * Sets a date and time value using the UTC time zone and the specified date and time format */ setValueUTC(dt: string, format: string): void; setXMLValue(xml: string): void; setYear(year: number): void; /** * Sets the year stored by the GlideDateTime object to a specified value using the current user's time zone */ setYearLocalTime(year: number): void; /** * Sets the year stored by the GlideDateTime object to a specified value using the UTC time zone */ setYearUTC(year: number): void; /** * Gets the duration difference between two GlideDateTime values. Pass a single paramter which specifies * milliseconds to subtract from the current GlideDateTime object */ subtract(gd: GlideTime): void; subtract(value: number): void; subtract(value: number): void; static subtract(start: GlideDateTime, end: GlideDateTime): GlideDuration; /** * Converts a datetime value to a string */ toString(): string; }