Date Format
While our recommendation is to send a string with the date in UTC and ISO8601 format, we understand that this may not always be the most practical.
Facturapi accepts dates as strings in any of the variations of the ISO8601 format. If your date includes information about a time zone, it will be respected; otherwise, it will be interpreted using the time zone of the issuing organization, which is deduced from the postal code registered for the organization.
The following table summarizes how Facturapi interprets dates sent to the API. The examples assume that the organization's time zone is GMT-06:00, Mexico Central Time.
Input | Description | Normalized with time zone | Normalized UTC |
---|---|---|---|
2022-01-01T00:00:00.000Z | Date and time in ISO8601 format. The Z at the end indicates the UTC time zone. | 2021-12-31T18:00:00.000-06:00 | 2022-01-01T00:00:00.000Z |
2022-01-01T00:00:00.000-06:00 | Date and time in ISO8601 format with the same time zone as the organization. | 2022-01-01T00:00:00.000-06:00 | 2022-01-01T06:00:00.000Z |
2022-01-01T00:00:00.000-08:00 | Date and time in ISO8601 format with a different time zone than the organization. | 2022-01-01T02:00:00.000-06:00 | 2022-01-01T08:00:00.000Z |
2022-01-01T00:00:00.000 | Date and time in ISO8601 format without a time zone. | 2022-01-01T00:00:00.000-06:00 | 2022-01-01T06:00:00.000Z |
2022-01-01 | Date in YYYY-MM-DD format | 2022-01-01T00:00:00.000-06:00 | 2022-01-01T06:00:00.000Z |
In response objects, our API will always return the date in ISO8601 format with the UTC time zone.
In invoices, the SAT (Mexican tax authority) requires that dates be displayed in the time zone of the issuer, so we will make the corresponding conversion and display the required portion of the date, which can be either just the date or the date and time.