OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
timepoint.hpp File Reference

Provides utilities for handling time points and formatting them as strings. More...

Namespaces

namespace  oxy
 This root namespace contains the common types and operations for the OXY-API library.

Typedefs

using oxy::local_time_point = std::chrono::local_time<std::chrono::duration<std::int64_t, std::micro>>
 Type aliases for different time point representations.
using oxy::time_point = std::chrono::system_clock::time_point
using oxy::utc_time_point = std::chrono::utc_clock::time_point

Functions

auto oxy::get_long_timestamp () -> std::string
 Gets the current UTC timestamp as a string in ISO 8601 format with microseconds (YYYY-MM-DDTHH:MM:SS.ssssss).
auto oxy::get_short_timestamp () -> std::string
 Gets the current UTC timestamp as a string in ISO 8601 format (YYYY-MM-DDTHH:MM:SS).
std::string oxy::normalize_iso8601 (const std::string &datetime)
 Normalizes an ISO 8601 datetime string by replacing the 'T' separator with a space.
std::chrono::sys_time< std::chrono::milliseconds > oxy::parse_iso8601 (const std::string &s)
 Parses an ISO 8601 formatted date-time string into a system time point with millisecond precision.
auto oxy::to_long_string (time_point const &aclock) -> std::string
 Converts a system clock time point to a string representation in ISO 8601 format with microseconds.
auto oxy::to_string (local_time_point const &aclock) -> std::string
 Converts a local time point to a string representation in ISO 8601 format.
auto oxy::to_string (time_point const &aclock) -> std::string
 Converts a system clock time point to a string representation in ISO 8601 format.
auto oxy::to_utc_long_string (utc_time_point const &aclock) -> std::string
 Converts a UTC clock time point to a string representation in ISO 8601 format with microseconds.
auto oxy::to_utc_string (time_point const &aclock) -> std::string
 Converts a UTC clock time point to a string representation in ISO 8601 format.
auto oxy::to_utc_string (utc_time_point const &aclock) -> std::string
 Converts a UTC clock time point to a string representation in ISO 8601 format with microseconds.

Detailed Description

Provides utilities for handling time points and formatting them as strings.

This header defines types and functions for working with time points in the oxy library. It includes type aliases for local, system, and UTC time points, as well as functions to convert these time points to string representations in various formats. The functions handle formatting according to ISO 8601 standards and provide utilities for generating timestamps.

@license MPL-2.0