Display_Lib_RPI 2.7.0
A C++ Library to connect electronic displays to Linux single board computers.
Loading...
Searching...
No Matches
Functions
rdlib_time Namespace Reference

Name space for time related utilities. More...

Functions

std::string UTC_string ()
 

Detailed Description

Name space for time related utilities.

Function Documentation

◆ UTC_string()

std::string rdlib_time::UTC_string ( )
@brief Returns the current UTC time as a formatted string.
@return std::string containing the current UTC time in "yyyy-mm-dd hh:mm:ss UTC" format.
@note Requires C++20 for std::format and std::chrono::floor support.
@details Uses std::chrono::system_clock to get the current time, truncates
    to second precision with std::chrono::floor, then formats the result
    using std::format with the ISO 8601 date and time specifiers.
    std::string time = UTC_string();

Returns e.g. "2026-06-02 19:13:21 UTC"

Returns
the current UTC time as a formatted string in the format "yyyy-mm-dd hh:mm:ss UTC".