ISO 8601 in SP-API
How to format time and dates for SP-API.
Amazon Selling Partner API (SP-API) formats date and time data similar to the RFC 3339 standard, which defines a subset profile of ISO 8601 for use in internet protocols and standards. This section will clarify how to format and use date and time data in SP-API.
Date and time data is expressed as Gregorian calendar dates (year, month, day) and a 24-hour day. No truncated formats are allowed. All date and time data is expressed numerically with leading zeros preserved.
DateTime string patterns are
yyyy-MM-ddTHH:mm:ss.sssZ (for UTC) or
yyyy-MM-ddTHH:mm:ss.sss±hh:mm (for a local time offset). The character
T is a required delimiter between the date and time sections. The colon (
:) is used as a delimiter between hours, minutes, and seconds. Fractional seconds are expressed with a decimal mark (
,) when needed.
All use of date and time data in SP-API should be expressed as type
DateTime. However, there are a few parameters that express date or time as a simple string. Check the parameter type definition to be sure of which type to use. Using the wrong type will generate an error.
While time intervals and durations are allowed under ISO 8601, they are not currently used in SP-API.
This example is read as the 16th day of March in 2016 at 14hrs 32min and 16.50 seconds local time. The local time is 7 hours behind UTC.
For more information
Updated about 2 months ago