Google Apps Script API
    Preparing search index...

    Apps Script has a non-standard Date Class

    https://github.com/microsoft/TypeScript/blob/master/lib/lib.es5.d.ts Enables basic storage and retrieval of dates and times.

    interface Date {
        getDate(): number;
        getDay(): number;
        getFullYear(): number;
        getHours(): number;
        getMilliseconds(): number;
        getMinutes(): number;
        getMonth(): number;
        getSeconds(): number;
        getTime(): number;
        getTimezoneOffset(): number;
        getUTCDate(): number;
        getUTCDay(): number;
        getUTCFullYear(): number;
        getUTCHours(): number;
        getUTCMilliseconds(): number;
        getUTCMinutes(): number;
        getUTCMonth(): number;
        getUTCSeconds(): number;
        setDate(date: number): number;
        setFullYear(year: number, month?: number, date?: number): number;
        setHours(hours: number, min?: number, sec?: number, ms?: number): number;
        setMilliseconds(ms: number): number;
        setMinutes(min: number, sec?: number, ms?: number): number;
        setMonth(month: number, date?: number): number;
        setSeconds(sec: number, ms?: number): number;
        setTime(time: number): number;
        setUTCDate(date: number): number;
        setUTCFullYear(year: number, month?: number, date?: number): number;
        setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;
        setUTCMilliseconds(ms: number): number;
        setUTCMinutes(min: number, sec?: number, ms?: number): number;
        setUTCMonth(month: number, date?: number): number;
        setUTCSeconds(sec: number, ms?: number): number;
        toDateString(): string;
        toISOString(): string;
        toJSON(key?: any): string;
        toLocaleDateString(): string;
        toLocaleString(): string;
        toLocaleTimeString(): string;
        toString(): string;
        toTimeString(): string;
        toUTCString(): string;
        valueOf(): number;
    }
    Index

    Methods

    • Sets the year of the Date object using local time.

      Parameters

      • year: number

        A numeric value for the year.

      • Optionalmonth: number

        A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.

      • Optionaldate: number

        A numeric value equal for the day of the month.

      Returns number

    • Sets the hour value in the Date object using local time.

      Parameters

      • hours: number

        A numeric value equal to the hours value.

      • Optionalmin: number

        A numeric value equal to the minutes value.

      • Optionalsec: number

        A numeric value equal to the seconds value.

      • Optionalms: number

        A numeric value equal to the milliseconds value.

      Returns number

    • Sets the month value in the Date object using local time.

      Parameters

      • month: number

        A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.

      • Optionaldate: number

        A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.

      Returns number

    • Sets the year value in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • year: number

        A numeric value equal to the year.

      • Optionalmonth: number

        A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.

      • Optionaldate: number

        A numeric value equal to the day of the month.

      Returns number

    • Sets the hours value in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • hours: number

        A numeric value equal to the hours value.

      • Optionalmin: number

        A numeric value equal to the minutes value.

      • Optionalsec: number

        A numeric value equal to the seconds value.

      • Optionalms: number

        A numeric value equal to the milliseconds value.

      Returns number

    • Sets the month value in the Date object using Universal Coordinated Time (UTC).

      Parameters

      • month: number

        A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.

      • Optionaldate: number

        A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.

      Returns number