Timestamp formatting

Overview

When ingesting events into our system, it is crucial to ensure that timestamps are formatted correctly to maintain consistency and facilitate accurate processing. Our system requires all timestamps to be in the ISO 8601 date-time format.

What is ISO 8601?

ISO 8601 is an international standard for date and time representations issued by the International Organization for Standardization (ISO). This standard aims to eliminate the risk of misinterpretation of numeric dates and times due to different conventions worldwide.

ISO 8601 Date-Time Format

Our system supports the following ISO 8601 date-time formats:

  • Date and Time with Time Zone: YYYY-MM-DDThh:mm:ss±hh:mm
    • Example: 2024-05-17T11:27:00+02:00 (Local time with offset)
  • Date and Time in UTC: YYYY-MM-DDThh:mm:ssZ
    • Example: 2024-05-15T08:56:00Z (UTC time)

Usage in Our API

When sending events to our API, ensure that the timestamp field is in one of the above formats. For example when ingesting an event:

{
  "meter_reference": "some_meter",
  "customer_reference": "some_customer",
  "timestamp": "2024-05-09T17:06:00+02:00"
}

Why Use ISO 8601?

Using ISO 8601 ensures that timestamps are unambiguous and easily parseable by systems worldwide. It prevents confusion that may arise from different date and time conventions and improves interoperability between different systems and services.

Handling Time Zones

It is essential to include time zone information to accurately represent the time of the event. Using Z denotes UTC time, while offsets like +02:00 specify the time zone relative to UTC.

Conclusion

Adhering to the ISO 8601 format for timestamps helps maintain data integrity and ensures that events are processed accurately. If you have any questions or need further assistance, please contact our support team.