YeongJunKim / issue

footprint of fixed error & some tips.
0 stars 0 forks source link

C++ get time to string #28

Open YeongJunKim opened 2 years ago

YeongJunKim commented 2 years ago
    std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
    auto in_time_t = std::chrono::system_clock::to_time_t(now);

    std::stringstream sstr;
    sstr << std::put_time(std::localtime(&in_time_t), "%Y-%m-%d %X");