Unify Framework Lib 1.6.0
ota_time.hpp File Reference

Time API for OTA POSIX specific. More...

#include <time.h>
#include <string>

Go to the source code of this file.

Functions

time_t calculate_utc_time_from_rfc_3339 (const std::string &date_time)
 Conversion from date string to UTC time in seconds. More...
 
std::string get_utc_time_string_from_utc_time (time_t time_input_utc)
 Conversion from time to string to UTC time. More...
 

Detailed Description

Time API for OTA POSIX specific.

This API allows conversion of date-time strings to UTC time as an absolute time measure.

Function Documentation

◆ calculate_utc_time_from_rfc_3339()

time_t calculate_utc_time_from_rfc_3339 ( const std::string &  date_time)

Conversion from date string to UTC time in seconds.

Parameters
date_timedate-time string in ISO8601 RFC 3339 format image.
Returns
time in seconds for date time in UTC.
Exceptions
std::invalid_argumentunable to parse time string.

◆ get_utc_time_string_from_utc_time()

std::string get_utc_time_string_from_utc_time ( time_t  time_input_utc)

Conversion from time to string to UTC time.

Parameters
time_input_utctime_t variable time in seconds.
Returns
date-time string from time input.