C++ Converting a time string to seconds from the epoch
Using C++11 functionality we can now use streams to parse times: The iomanip std::get_time will convert a string based on a set of format parameters and convert them into a struct tz object. You can then use std::mktime() to convert this into an epoch value. #include <iostream> #include <sstream> #include <locale> #include <iomanip> int main() … Read more