Commit bd7bc17c authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Used std::put_time instead of std::strftime in SystemInfo

parent 32c75310
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
#include <set>
#include <iomanip>
#include <cstring>
#include <ctime>

#include <unistd.h>
#include <sys/utsname.h>
@@ -65,13 +64,9 @@ SystemInfo::getCurrentTime( const char* format )
{
   const std::time_t time_since_epoch = std::time( nullptr );
   std::tm* localtime = std::localtime( &time_since_epoch );
   // TODO: use std::put_time in the future (available since GCC 5)
//   std::stringstream ss;
//   ss << std::put_time( localtime, format );
//   return String( ss.str().c_str() );
   char buffer[1024];
   std::strftime( buffer, 1024, format, localtime );
   return String( buffer );
   std::stringstream ss;
   ss << std::put_time( localtime, format );
   return String( ss.str().c_str() );
}