What time zone should I use when passing date/time values through the public APIs?
Environment:
Connect Web Services for SOAP
Connect REST API
Connect PHP API
ROQL
Issue:
The date/time field values or report filters do not correspond to the values I entered. There is a difference of a few hours between what I enter in the web service request and what I see in the system.
Resolution:
When passing date/time values as reporting filters or field values, they need to be normalized to UTC. The date/time values stored in the Oracle B2C Service platform are normalized to UTC - it is your responsibility to convert them to UTC (adjust from local time) and transmit the values with a trailing "Z", which indicates the time is UTC time.
The following is an example of a UTC formatted date:
2020-05-11T18:26:28Z
Any date/time value supplied in a request that is not in UTC format will be rejected by the Oracle B2C Service platform. If the time format is not valid, a RequestFault is returned.
The date/time value you see in the agent desktop, customer portal and the browser user interface (BUI) are based on the value of the TZ_INTERFACE configuration setting. Depending on the time zone you have specified in the TZ_INTERFACE configuration setting, the time may adjust automatically for daylight savings time as noted in Daylight Savings changes are automatic. As the Oracle B2C Service APIs use UTC date/time in processing and values returned, you may see a difference in the date/time and the records returned as UTC does not adjust for daylight savings time.
For more information please review the API documentation:
Answer ID 5169: Technical Documentation and Sample Code