File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -19,17 +19,19 @@ namespace KAFKA_API::utility {
1919 */
2020inline std::string getLocalTimeString (const std::chrono::system_clock::time_point& timePoint)
2121{
22- auto micros = std::chrono::duration_cast<std::chrono::microseconds>(timePoint.time_since_epoch ()) % 1000000 ;
2322 auto time = std::chrono::system_clock::to_time_t (timePoint);
24-
25- std::ostringstream oss;
2623 std::tm tmBuf = {};
24+
2725#if !defined(WIN32)
28- oss << std::put_time ( localtime_r (&time, &tmBuf), " %F %T " ) << " . " << std::setfill ( ' 0 ' ) << std::setw ( 6 ) << micros. count ( );
26+ localtime_r (&time, &tmBuf);
2927#else
3028 localtime_s (&tmBuf, &time);
31- oss << std::put_time (&tmBuf, " %F %T" ) << " ." << std::setfill (' 0' ) << std::setw (6 ) << micros.count ();
3229#endif
30+
31+ std::ostringstream oss;
32+ oss << std::put_time (&tmBuf, " %F %T" ) << " ." << std::setfill (' 0' ) << std::setw (6 )
33+ << std::chrono::duration_cast<std::chrono::microseconds>(timePoint.time_since_epoch ()).count () % 1000000 ;
34+
3335 return oss.str ();
3436}
3537
You can’t perform that action at this time.
0 commit comments