parse date and times with {fmt} style intostd::chrono::time_point {WIP}
include(FetchContent)
FetchContent_Declare(
chrono_parse
GIT_REPOSITORY https://github.com/mguludag/chrono_parse.git
GIT_TAG main # or the specific tag or branch you want to use
)
FetchContent_MakeAvailable(chrono_parse)
#...
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE mgutility::chrono_parse)#include "mgutility/chrono/parse.hpp"
// {fmt} for printing
#include <fmt/chrono.h>
#include <fmt/format.h>
int main() {
const auto chrono_time = mgutility::chrono::parse("{:%FT%T.%f%z}", "2023-04-16T00:05:23.999+0100");
fmt::print("{:%F %T}\n", chrono_time); // prints 2023-04-15 23:05:23.999000000 ({fmt} trunk version)
}- Performance is ~20x faster than
std::get_time+std::mktime.
clang 17 libc++ c++23 -OFast
clang 17 libstdc++ c++23 -OFast
gcc 13.2 libstdc++ c++23 -OFast



