Skip to content
Snippets Groups Projects
Commit 6e692328 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed tnlSystemInfo::getCurrentTime method

parent ff01eea0
No related branches found
No related tags found
No related merge requests found
......@@ -93,9 +93,13 @@ tnlSystemInfo::getCurrentTime( const char* format ) const
{
const std::time_t time_since_epoch = std::time( nullptr );
std::tm* localtime = std::localtime( &time_since_epoch );
std::stringstream ss;
ss << std::put_time( localtime, format );
return tnlString( ss.str().c_str() );
// TODO: use std::put_time in the future (available since GCC 5)
// std::stringstream ss;
// ss << std::put_time( localtime, format );
// return tnlString( ss.str().c_str() );
char buffer[1024];
std::strftime( buffer, 1024, format, localtime );
return tnlString( buffer );
}
int
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment