Enigma
3.2.0
A Simple, Reliable and Efficient Encryption Tool
|
Namespace contains useful Date Time related utility functions. More...
Functions | |
static std::string | toString (const std::time_t &time, const std::string_view &format="%Y-%m-%d %H:%M:%S") |
Converts an std::time_t to a string date time with a specific format. More... | |
static std::time_t | fromString (const std::string &dateTimeStr, const std::string_view &format="%Y-%m-%d %H:%M:%S") |
Converts a string date time with a specific format to an std::time_t. More... | |
static std::string | now (const std::string_view &format="%Y-%m-%d %H:%M:%S") |
returns current date and time as a string with a specific format More... | |
Namespace contains useful Date Time related utility functions.
|
static |
Converts a string date time with a specific format to an std::time_t.
dateTimeStr | String date time to convert |
format | Format of the string date to return. Default Y-m-d H:M:S (e.g 2023-10-25 12:55:05) https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html |
Definition at line 30 of file DateTimeUtils.hpp.
|
static |
returns current date and time as a string with a specific format
format | Format of the date to return. Default Y-m-d H:M:S (e.g 2023-10-25 12:55:05) https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html |
Definition at line 40 of file DateTimeUtils.hpp.
|
static |
Converts an std::time_t to a string date time with a specific format.
time | std::time_t value to convert |
format | Format of the date to return. Default Y-m-d H:M:S (e.g 2023-10-25 12:55:05) https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html |
Definition at line 14 of file DateTimeUtils.hpp.