[libcxx] r290824 - chrono: correct the units for the epoch bias

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 2 10:41:50 PST 2017


Author: compnerd
Date: Mon Jan  2 12:41:50 2017
New Revision: 290824

URL: http://llvm.org/viewvc/llvm-project?rev=290824&view=rev
Log:
chrono: correct the units for the epoch bias

As pointed out by Howard, this is actually 134774 days (* 24 * 3600),
and therefore seconds, not 100ns units.  Adjust the units to reflect
reality.

Modified:
    libcxx/trunk/src/chrono.cpp

Modified: libcxx/trunk/src/chrono.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/chrono.cpp?rev=290824&r1=290823&r2=290824&view=diff
==============================================================================
--- libcxx/trunk/src/chrono.cpp (original)
+++ libcxx/trunk/src/chrono.cpp Mon Jan  2 12:41:50 2017
@@ -53,8 +53,7 @@ system_clock::now() _NOEXCEPT
                                                     nanoseconds::period>>;
 
   // The Windows epoch is Jan 1 1601, the Unix epoch Jan 1 1970.
-  static _LIBCPP_CONSTEXPR const filetime_duration
-      nt_to_unix_epoch{11644473600};
+  static _LIBCPP_CONSTEXPR const seconds nt_to_unix_epoch{11644473600};
 
   FILETIME ft;
 #if _WIN32_WINNT >= _WIN32_WINNT_WIN8




More information about the cfe-commits mailing list