|
template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t> |
static std::basic_string< T > | ISO8601 (const std::chrono::system_clock::time_point &rawtp=std::chrono::system_clock::now()) |
| Converts the argument to ISO8601 format. More...
|
|
template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t> |
static std::basic_string< T > | RFC7231 (const std::chrono::system_clock::time_point &rawtp=std::chrono::system_clock::now()) |
| Build a time and date string compliant with the RFC7231. More...
|
|
template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t> |
static std::basic_string< T > | toTimespan (const std::chrono::seconds &arg) |
| Returns D.HH:MM:SS ; days.hours:minutes:seconds. More...
|
|
template<class T = std::string>
requires std::same_as<T, std::string> || std::same_as<T, std::wstring> || std::same_as<T, uint64_t> |
static std::chrono::system_clock::time_point | parseEpoch (const T &arg) |
| Converts the epoch time into a time_point. The reason for string is due to the permissibility of epoch with decimals where the portion after the decimal represents milliseconds. More...
|
|
template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t> |
static std::tuple< std::chrono::milliseconds, std::basic_string< T > > | diff (const std::chrono::time_point< std::chrono::system_clock > &end, const std::chrono::time_point< std::chrono::system_clock > &start) |
| Returns a tuple where the first is the chrono::duration<Z> and the second is std::basic_string<T> as. More...
|
|
template<typename T = char, typename D = std::chrono::microseconds>
requires std::same_as<T, char> || std::same_as<T, wchar_t> |
static std::basic_string< T > | durationString (const D &arg) |
| Return string with weeks days hours minutes seconds for the provided duration (default microseconds) More...
|
|
template<class T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t> |
static std::chrono::system_clock::time_point | parseISO8601 (const std::basic_string< T > &arg) |
| Converts from ISO8601 format string into time_point. More...
|
|
Date Time utilities for REST API.
Definition at line 69 of file date-utils.hpp.
template<typename T = char, typename D = std::chrono::microseconds>
requires std::same_as<T, char> || std::same_as<T, wchar_t>
static std::basic_string< T > siddiqsoft::DateUtils::durationString |
( |
const D & |
arg | ) |
|
|
inlinestatic |
Return string with weeks days hours minutes seconds for the provided duration (default microseconds)
- Parameters
-
arg | Expressed as uint64_t so we can relay any resolution: us, ms, ns, s.. |
- Returns
- string years/months/weeks days and hour minute second and millis The years/months are in "parallel" to the weeks days hours minutes seconds The seconds is rounded up if we end up with 500ms after the split years / months / weeks days hours minutes seconds months / weeks days hours minutes seconds weeks days hours minutes seconds days hours minutes seconds hours minutes seconds minutes seconds minutes seconds milliseconds
Definition at line 279 of file date-utils.hpp.
template<class T = std::string>
requires std::same_as<T, std::string> || std::same_as<T, std::wstring> || std::same_as<T, uint64_t>
static std::chrono::system_clock::time_point siddiqsoft::DateUtils::parseEpoch |
( |
const T & |
arg | ) |
|
|
inlinestatic |
Converts the epoch time into a time_point. The reason for string is due to the permissibility of epoch with decimals where the portion after the decimal represents milliseconds.
- Template Parameters
-
T | Must be either std::string or std::wstring or as uint64_t |
- Parameters
-
- Returns
- time_point
Definition at line 177 of file date-utils.hpp.