APIs and automation
Spreadsheet Dates in APIs: Avoid Ambiguous Formats and Day Changes
A practical guide to defining what each date represents, agreeing on an explicit format, and checking that data retains its meaning as it moves between a spreadsheet and an API.
Why a date that looks the same can mean different things
A cell may display “03/04/2025,” but that appearance alone is not enough to tell whether it represents April 3 or March 4. The spreadsheet may interpret the value according to its settings, the cell pattern, or the way it was entered. When the data is sent to another system, the API may also apply its own rules. Microsoft explains that date interpretation rules in spreadsheet programs can be complex and recommends specifying them as clearly as possible in its [guide to date systems, formats, and interpretation](https://support.microsoft.com/es-es/excel/change-the-date-system-format-or-two-digit-year-interpretation).
For this reason, do not treat visual presentation as an integration contract. Before exporting, identify the cells that contain dates, check what values they represent, and agree on how the receiving system should interpret them. The [Google Sheets API guide to date and number formats](https://developers.google.com/workspace/sheets/api/guides/formats?hl=es-419) describes format patterns that can be included in requests; consult the documentation for the specific service to confirm what it supports.
- Avoid numeric dates where the day and month can be swapped unless the contract defines their order.
- Do not assume that a cell’s visible format determines how the API will interpret its data.
Decide whether the field is a calendar date or an instant
Before choosing a format, define what the field means. In this guide, a calendar date identifies a day, such as a task’s due date; by itself, it does not indicate a time or location. An instant represents a specific point in time, such as when a transaction was recorded. Although both values may look like dates in a spreadsheet, the contract must clarify which meaning is expected.
Write this distinction into the data contract, not just an informal note. For each column, record its name, meaning, expected type, whether empty values are allowed, and a valid example. If a field represents only a day, do not add a fictitious time just to satisfy an integration. If it represents an instant, specify how the time and the time-zone context required by the consumer are expressed.
- Ask: “Does this data need to remain the same day for all users?” If so, define the field as a calendar date.
- Ask: “Do we need to know when something happened?” If so, define how the time and time-zone context will be handled for that integration.
Use an explicit representation and data contract
For this integration’s contract, you can choose an ordered year-month-day pattern, such as “2025-04-03,” instead of “03/04/2025.” For instants, also specify how the time and time-zone context are expressed. Do not rely on a spreadsheet’s regional settings: the producer and consumer must agree on the same format and meaning.
Document any exceptions relevant to the specific service: whether seconds are allowed, what precision is used, how the time-zone context is indicated, and what counts as invalid. Do not confuse format with meaning: a cell displayed as a date could contain text or another value. The Google Sheets API guide cited above covers format patterns that can be included in requests; it does not replace the contract definition or, by itself, establish what a field means for your integration.
- Define the format, type, time-zone context if applicable, precision, whether the value is required, and an example for each column.
- Reject values that do not meet the contract or send them for review; do not silently “correct” them.
Specify time-zone context when the data requires it
If the field expresses only a calendar date, define whether the process needs any additional time-related data. For an event with a specific time, agree on the time-zone context the producer and consumer will use, and record that decision in the contract. Avoid mixing a local time with a different interpretation elsewhere in the flow.
If the flow needs to preserve an event’s local time, document the rule and test the important cases for that integration, including those near midnight. A date change when displaying a value is not, on its own, enough to conclude that the original was corrupted: compare the result with the meaning and rules defined in the contract. If the field expresses only a date, avoid adding time information the process does not need.
- For every instant, document the time-zone context agreed on by the producer and consumer.
- Check cases near midnight that are relevant to your flow; compare the result with the contract before deciding whether there is an error.
Test the cases defined for your integration
To check the behavior of a specific flow, prepare test cases that match its contract. You could include dates where the day and month might be confused, values close to a date change, an empty cell, text that is not a date, and a value with unexpected precision or time-zone context. Decide in advance whether each case should be accepted, rejected, or held for review. This list is a validation practice for the integration, not a claim about the requirements of an external standard.
Empty values deserve their own rule. Define what an empty cell means and prevent the process from automatically assigning it another value that was not agreed upon. If the flow needs to distinguish between “no data,” “unknown,” and “not applicable,” document those options. For invalid values, define an identifiable response or stop the submission so the source can be corrected; do not silently substitute data.
- Possible test list: ambiguous date, end of month, year change, midnight, empty value, and invalid text.
- Check what the consumer receives and what the operator sees when validation fails.
Check the data flow before using it
As a practical check for the specific flow, prepare a small set of representative records and keep a copy of their initial values. Send them through the intended path and inspect the received values; if the process includes loading them back into a spreadsheet, review that result as well. Compare meaning, not just appearance: a date that returns with a different visual style may still be correct, while a change in day or time may violate the contract.
Repeat the check with the chosen cases and note the expected and observed results. If a difference appears, review where it arose: spreadsheet interpretation, transformation, API request, or response presentation. Adjust the contract or conversion and run the same set again to check the result of the change.
- Save the input, value sent, response, and visible result so you can compare each step.
- Consider the check successful only if the agreed meaning is preserved and the expected errors are detected.
Organize review and integration in Apification
As a workflow practice, keep a test spreadsheet separate from operational data. In Apification Cloud, you can organize files and projects in a versioned workspace and create or edit spreadsheets with ONLYOFFICE without moving them out of Cloud storage. Review the headers, visible formats, empty values, and examples there before preparing the integration. The spreadsheet makes team inspection easier, but it does not replace the validation rules of the service that consumes or sends the data.
Apification lets you integrate Cloud and its services through REST API, OpenAPI, webhooks, iframe, and JavaScript. Consult the relevant API documentation to define the actual exchange: do not assume a specific endpoint or behavior based on these capabilities. After a significant change, Cloud’s item history lets you review earlier versions, download them, and restore content. This resource can help recover a working spreadsheet, but it does not replace contract checks or review of the results.
- Before connecting real data, validate a working copy with representative examples and agreed rules.
- Check the API documentation to confirm which operation and format the specific service supports.
- If a spreadsheet is altered, review its history and keep a known version to make recovery easier.
Frequently asked questions
What format should I use to send a date to an API?
Agree on an explicit format with the consumer. For a calendar date, an ordered pattern such as year-month-day avoids relying on an ambiguous notation like day/month. For an instant, also define the time and time-zone context required by that integration.
Do all dates in a spreadsheet need time-zone context?
Not necessarily. If the field identifies only a day, the contract may not require a time or time-zone context. If it represents an instant, define the time-zone context needed for the producer and consumer to interpret the value consistently.
How can I check that a conversion did not change the day?
For the specific flow, keep the input data and compare its meaning when received and, where relevant, when displayed again. Include cases near midnight and review each stage if you find differences.
Does ONLYOFFICE in Apification automatically validate an API format?
The verified capability is creating and editing spreadsheets with ONLYOFFICE within Cloud. API format validation and behavior must be defined and checked for the specific integration.
Sources and further reading
Documentation consulted while preparing this article.
- Cambiar el sistema, formato o la interpretación de los años de las fechas — Microsoft Support
- Formatos de fecha y número — Google Sheets API
Explore Apification
Related articles
APIs and automation
API Pagination: How to Navigate a Collection
Learn how to read pagination documentation, follow its continuation instructions, and assess whether a collection traversal reached its documented end.
APIs and automation
Change an API-Connected Form Without Breaking the Integration
A cautious, practical guide to changing labels, fields, formats, and required-field rules while checking how receiving systems respond.
APIs and automation
File transformation states: progress, errors, and downloads without confusion
A practical guide to defining clear states in file conversions, distinguishing originals from results, and coordinating API, webhooks, and support.