docx
    Preparing search index...

    Function dateTimeValue

    • Converts a JavaScript Date object to an ISO 8601 date-time string.

      The format is CCYY-MM-DDThh:mm:ss.sssZ where T is a literal and Z indicates UTC. This matches the xsd:dateTime format required by OOXML.

      Reference: ST_DateTime in OOXML specification

      Parameters

      • val: Date

        The Date object to convert

      Returns string

      An ISO 8601 formatted date-time string

      const now = new Date();
      const timestamp = dateTimeValue(now); // Returns "2024-01-15T10:30:00.000Z"