Date Time Fields
Request
The API accepts date-time fields in the request body in the following three system formats:
- yyyy-MM-dd'T'HH:mm:ss
- yyyy-MM-dd'T'HH:mm:ssZ
- yyyy-MM-dd'T'HH:mm:ss.Z
If an API user intends to provide the date-time fields in any other ISO 8601 complaint format, that format has to be provided as a value using the API header field Request-Date-Time-Format to complete the proper parsing of the date-time field.
Example values for the header:
- Any of the above system formats
- ISO 8601 Standard formats, for example:
- yyyy-MM-dd'T'HH:mm:ss+HH:mm
- yyyy-MM-dd'T'HH:mm:ss.SSSZ
The system returns an invalid format error when a date-time value in the request body or an entity filter does not comply with a supported system format or with the format specified in the Request-Date-Time-Format header.
Response
A user can specify the format in which to retrieve the date-time fields through the API header Response-Date-Time-Format to complete the proper publishing of date-time fields.
Example values for the above header:
- OPC system format
- yyyy-MM-dd'T'HH:mm:ss.Z
- ISO 8601 Standard Formats, for example:
- yyyy-MM-dd'T'HH:mm:ss
- yyyy-MM-dd'T'HH:mm:ssZ
- yyyy-MM-dd'T'HH:mm:ss+HH:mm
- yyyy-MM-dd'T'HH:mm:ss.SSSZ
The system returns an invalid format error if the header doesn't comply with the system format or the standard ISO 8601 formats.
Note: To avoid failing existing integrations, the system previously did not return an error if a date-time field in any API request was provided in a custom format that did not comply with the three supported system formats (yyyy-MM-dd'T'HH:mm:ss, yyyy-MM-dd'T'HH:mm:ssZ, yyyy-MM-dd'T'HH:mm:ss.Z) and was not specified using the Request-Date-Time-Format header. The system ignored this date value and treated it as null because it cannot be parsed. This can cause issues because the requested date value is not saved. Starting with the 26.1 API release, the system no longer ignores noncompliant dates and returns an error.