It seems pretty likely wx has something like this I can just use... I found this code which works but would rather not reinvent the wheel
Code: Select all
struct tm *pTime;
time_t ctTime; time(&ctTime);
pTime = localtime( &ctTime );
std::ostringstream oss;
oss << std::setw(2) << std::setfill('0') << (pTime->tm_mon + 1)
<< std::setw(2) << std::setfill('0') << pTime->tm_mday
<< std::setw(2) << std::setfill('0') << (pTime->tm_year + 1900)
<< "_" << std::setw(2) << std::setfill('0') << pTime->tm_hour
<< std::setw(2) << std::setfill('0') << pTime->tm_min
<< std::setw(2) << std::setfill('0') << pTime->tm_sec
<< std::setw(3) << std::setfill('0') << (mTimer->getMilliseconds() % 1000);