|
ORE Studio 0.0.4
|
Custom reflector for std::chrono::system_clock::time_point. More...
#include <reflectors.hpp>

Public Types | |
| using | ReflType = std::string |
Static Public Member Functions | |
| static std::chrono::system_clock::time_point | to (const ReflType &str) |
| Parses a string into a time_point. | |
| static ReflType | from (const std::chrono::system_clock::time_point &v) |
| Formats a time_point into a string. | |
Custom reflector for std::chrono::system_clock::time_point.
Serializes to and from an ISO 8601 compliant UTC string. This is the idiomatic C++23 approach, using std::format and std::chrono::parse for type-safe and portable operations.
Serialized format: "YYYY-MM-DD HH:MM:SS" (assumed to be UTC) Example: "2023-10-27 14:45:30"
|
static |
Parses a string into a time_point.
Uses std::chrono::from_stream (C++20) to safely parse the string format into a std::chrono::sys_timepoint.
| str | The string to parse. |
| std::runtime_error | if the string cannot be parsed. |
|
static |
Formats a time_point into a string.
Uses std::format (C++23) to create a clean, unambiguous UTC string representation. This avoids all C-style time functions.
| v | The time_point to format. |