marzer / tomlplusplus

Header-only TOML config file parser and serializer for C++17.
https://marzer.github.io/tomlplusplus/
MIT License
1.47k stars 141 forks source link

How to convert toml::date_time to std::chrono::time_point? #210

Closed Gwill closed 8 months ago

Gwill commented 8 months ago

How to convert toml::date_time to std::chrono::time_point?

marzer commented 8 months ago

There's no built-in way to do this; you'd need to do a bit of math. I'm not very familiar with std::chrono so I can't think how to do this currently, but I'll have a look into it.

marzer commented 8 months ago

Looks like the snippets here are what you want: StackOverflow

Should be relatively easy to tweak it to use toml::date_time as the source.