Fix GlogFormatterTest on Windows
[folly.git] / folly / experimental / logging / test / GlogFormatterTest.cpp
index 067fcb10d74d56ec5c9fd562dc2017f96c5b9956..a10c380ac21cbf08f95b53e3c36286d0329dd201 100644 (file)
@@ -21,6 +21,7 @@
 #include <folly/experimental/logging/LoggerDB.h>
 #include <folly/init/Init.h>
 #include <folly/portability/GTest.h>
+#include <folly/portability/Stdlib.h>
 
 using namespace folly;
 
@@ -47,7 +48,8 @@ std::string formatMsg(
   GlogStyleFormatter formatter;
 
   std::chrono::system_clock::time_point logTimePoint{
-      std::chrono::nanoseconds{timestampNS}};
+      std::chrono::duration_cast<std::chrono::system_clock::duration>(
+          std::chrono::nanoseconds{timestampNS})};
   LogMessage logMessage{
       category, level, logTimePoint, filename, lineNumber, msg.str()};