From 8345cf8c49a228b289464fdadb51e6e7ab698211 Mon Sep 17 00:00:00 2001 From: Andrey Akinshin Date: Thu, 30 Mar 2017 18:25:42 +0500 Subject: [PATCH] Fix magic number explanation in filetime.cpp (dotnet/coreclr#10582) 89 * 366 + 280 * 365 equals to 134774 (not 134744) Commit migrated from https://github.com/dotnet/coreclr/commit/44d4a46497a3a3e0881793c998f392a18dfe3a91 --- src/coreclr/src/pal/src/file/filetime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/pal/src/file/filetime.cpp b/src/coreclr/src/pal/src/file/filetime.cpp index 4e55e18..ca36e04 100644 --- a/src/coreclr/src/pal/src/file/filetime.cpp +++ b/src/coreclr/src/pal/src/file/filetime.cpp @@ -81,8 +81,8 @@ SET_DEFAULT_DEBUG_CHANNEL(FILE); Both epochs are Gregorian. 1970 - 1601 = 369. Assuming a leap year every four years, 369 / 4 = 92. However, 1700, 1800, and 1900 were NOT leap years, so 89 leap years, 280 non-leap years. - 89 * 366 + 280 * 365 = 134744 days between epochs. Of course - 60 * 60 * 24 = 86400 seconds per day, so 134744 * 86400 = + 89 * 366 + 280 * 365 = 134774 days between epochs. Of course + 60 * 60 * 24 = 86400 seconds per day, so 134774 * 86400 = 11644473600 = SECS_BETWEEN_1601_AND_1970_EPOCHS. To 2001: -- 2.7.4