Index: src/date.cc |
diff --git a/src/date.cc b/src/date.cc |
index 3106b1622b3c1735bd8c53196e424588e860f8d1..8cbf5a602ae1ea888939e6ade8b6228cdb855e37 100644 |
--- a/src/date.cc |
+++ b/src/date.cc |
@@ -175,6 +175,20 @@ int DateCache::DaysFromYearMonth(int year, int month) { |
} |
+void DateCache::BreakDownTime(int64_t time_ms, int* year, int* month, int* day, |
+ int* weekday, int* hour, int* min, int* sec, |
+ int* ms) { |
+ int const days = DaysFromTime(time_ms); |
+ int const time_in_day_ms = TimeInDay(time_ms, days); |
+ YearMonthDayFromDays(days, year, month, day); |
+ *weekday = Weekday(days); |
+ *hour = time_in_day_ms / (60 * 60 * 1000); |
+ *min = (time_in_day_ms / (60 * 1000)) % 60; |
+ *sec = (time_in_day_ms / 1000) % 60; |
+ *ms = time_in_day_ms % 1000; |
+} |
+ |
+ |
void DateCache::ExtendTheAfterSegment(int time_sec, int offset_ms) { |
if (after_->offset_ms == offset_ms && |
after_->start_sec <= time_sec + kDefaultDSTDeltaInSec && |