Time Zone Offsets
Here is how we handle time zone offsets in API v2 calls:
- We use the following standard date format: ISO_8601_FORMAT_DATE_TIME = "YYYY-MM-DD'T'hh:mm:ss±hh:mm".
- We calculate the offset for the date sent by the client, at that moment in time, taking into consideration the tenant’s time zone. For example: "−05:00" for New York on standard time (UTC-05:00), "−04:00" for New York on daylight saving time (UTC-04:00).
- We compare the offset value sent by the client with the offset value calculated by us. If they don’t match an exception is thrown which informs the client about the correct offset. See example.
Example JSON body showing an invalid date offset request
{
"errors": [
{
"errorCode": 4,
"errorSource": "Invalid date offset for value 2021-03-09T13:37:50 org offset is +02:00",
"errorReason": "INVALID_PARAMETERS"
}
]
}
Example
Each Mambu tenant has one time zone. Let’s take for example tenants in the East European time zone (UTC+02:00).
| Date and time of request | Error message or What is saved in the database |
|---|---|
| 2021-03-09T13:37:50 | “Invalid date offset for value 2021-03-09T13:37:50 org offset is +02:00” |
| 2021-03-09T13:37:50+03:00 | “Invalid date offset for value 2021-03-09T13:37:50 org offset is +02:00” |
| 2021-03-09T13:37:50+02:00 | 2021-03-09 13:37:50 |
When posting a transaction in the present, the current offset should be used, according to the tenant’s time zone.When posting a backdated transaction, the offset as it was on the day and time of the backdated transaction should be used, according to the tenant’s time zone.When posting a transaction in the future, the future offset should be used, according to the tenant’s time zone.If your country uses Daylight Saving Time, posting transactions that occur during 'lost' hours, for example between 02:00:00 a.m. CEST and 2:59:59 a.m. CEST, will result in API error messages related to the offset. We also generally recommend not processing API calls during the minutes leading up to and after the switchover as small differences in clock synchronisation across various systems and services may lead to unexpected errors.