The Heex SDK excels in Smart Data management using an innovative event-based approach. Each event is given a timestamp, capturing its exact occurrence time. The encoding of these timestamps plays a crucial role in messaging and storage. This page is your go-to guide, detailing the specifications for timestamp encoding in the dynamic realms of messaging and storage.

HeexSDK methods requires timestamps in UTC time.

For example, every timestamp generated by default uses the std::chrono::system_clock::now().

Format

HeexSDK uses the ISO 8601-1:2019 standard. It is a string representation of dates and times. The main advantage is the availability of many libraries dealing with this representation.

There are many options, but the format favored by Heex is YYYY-MM-DDThh:mm:ss.ssssssZ.

  • YYYY is the year
  • MM is the month
  • DD is the day
  • T is a separator
  • hh is for hours
  • mm is for minutes
  • ss is for seconds
  • ssssss (following the dot) is for microseconds
  • Z to indicate that we are in UTC+0

Example:

2021-07-07T13:54:05.123456Z

See also this Wikipedia article for more details.

Notes on Usage & Conversion

Heex uses the std::chrono library to generate or read timestamps. Therefore, you need to convert your timestamp if it is stored in Posix, Boost or Unix time (time_t). Some utility functions do exist in the C++ Standard Library (std) to perform the conversion. In addition, some middleware like ROS2 also provide a custom time format that need to be converted.

We also provide custom conversion libraries, that can be found in our HeexUtilsTime.h file.