How-to Guide: Working with Date and Time Fields

Overview

This guide provides an overview of how to work with date and time fields when interacting with our API. To ensure consistency and avoid confusion across different time zones, all datetime fields in requests and responses are handled in Coordinated Universal Time (UTC).

Formatting Datetime Fields

When submitting requests to the API, ensure all datetime fields are formatted according to the ISO 8601 standard in UTC. The expected format is:

YYYY-MM-DDTHH:MM:SSZ

Submitting a Request with Datetime Fields

When you submit a request that includes datetime fields, convert any local times to UTC.

Request Example:

Here is how you would include a datetime field in a JSON request body:

{

"event": "Sample Event",

"start_date": "2024-04-03T12:34:56Z"

}

Parsing Datetime Fields in Responses

All datetime fields in API responses are also provided in UTC. It's recommended that you convert these UTC times to your local timezone or the user's preferred timezone before displaying them.

Best Practices

  • Always work with UTC times when interacting with the API to avoid timezone-related errors.

  • Convert local times to UTC before making API requests.

  • Convert UTC times to local times after receiving API responses for better user experience.

Resources

© Copyright 2021 | Axacute Pte. Ltd. | All Rights Reserved