• Given a date object, returns a corresponding ISO8601 representating the localtime without offset

    Parameters

    • date: undefined | Date

      date value to serialize

    Returns string | undefined

    a corresponding ISO8601 string representating the localtime without offset

    const originalDatetimeString: string = '2021-03-25T01:00:00-07:00';
    const datetimeNoOffset: Date = new Date(originalDatetimeString);
    // datetimeNoOffset -> Thu Mar 25 2021 01:00:00 GMT-0700 (Pacific Daylight Time)

    const serializedDatetime: string | undefined = serializeDateValue(datetimeNoOffset);
    // serializedDatetime -> 2021-03-25T01:00:00