summaryrefslogtreecommitdiff
path: root/absl/time/time.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/time/time.cc')
-rw-r--r--absl/time/time.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/absl/time/time.cc b/absl/time/time.cc
index e60857e2..2c7da3ad 100644
--- a/absl/time/time.cc
+++ b/absl/time/time.cc
@@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,6 +33,10 @@
#include "absl/time/time.h"
+#if defined(_MSC_VER)
+#include <winsock2.h> // for timeval
+#endif
+
#include <cstring>
#include <ctime>
#include <limits>
@@ -41,8 +45,9 @@
#include "absl/time/internal/cctz/include/cctz/time_zone.h"
namespace cctz = absl::time_internal::cctz;
+
namespace absl {
-inline namespace lts_2018_12_18 {
+inline namespace lts_2019_08_08 {
namespace {
@@ -453,8 +458,7 @@ struct tm ToTM(absl::Time t, absl::TimeZone tz) {
tm.tm_year = static_cast<int>(cs.year() - 1900);
}
- const CivilDay cd(cs);
- switch (GetWeekday(cd)) {
+ switch (GetWeekday(cs)) {
case Weekday::sunday:
tm.tm_wday = 0;
break;
@@ -477,11 +481,11 @@ struct tm ToTM(absl::Time t, absl::TimeZone tz) {
tm.tm_wday = 6;
break;
}
- tm.tm_yday = GetYearDay(cd) - 1;
+ tm.tm_yday = GetYearDay(cs) - 1;
tm.tm_isdst = ci.is_dst ? 1 : 0;
return tm;
}
-} // inline namespace lts_2018_12_18
+} // inline namespace lts_2019_08_08
} // namespace absl