(C++) TimeToStr

January 10, 2018 · View on GitHub

 

 

 

 

 

(C++) TimeToStr

 

TimeToStr is a time conversion code snippet to convert std::time_t to std::string.

 


#include <ctime> #include <string> ///TimeToStr converts std::time_t to std::string. ///From http://www.richelbilderbeek.nl/CppTimeToStr.htm const std::string TimeToStr(const std::time_t& time) {   return std::ctime( &time); }