48 static_cast<int64_t
>(
kMaxInt) * 1000;
52 static_cast<int64_t
>(864000000) * 10000000;
78 if (time_ms < 0) time_ms -= (
kMsPerDay - 1);
79 return static_cast<int>(time_ms /
kMsPerDay);
86 return static_cast<int>(time_ms - days *
kMsPerDay);
93 int result = (days + 4) % 7;
94 return result >= 0 ? result : result + 7;
99 return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
108 return local_offset_ms_;
121 int64_t local_ms =
ToLocal(time_ms);
122 return static_cast<int>((time_ms - local_ms) /
kMsPerMin);
127 return time_ms +
LocalOffsetInMs() + DaylightSavingsOffsetInMs(time_ms);
133 return time_ms - DaylightSavingsOffsetInMs(time_ms);
148 int time_within_day_ms =
static_cast<int>(time_ms - days *
kMsPerDay);
149 int year, month, day;
152 return static_cast<int64_t
>(new_days) *
kMsPerDay + time_within_day_ms;
161 int recent_year = (
IsLeap(year) ? 1956 : 1967) + (week_day * 12) % 28;
164 return 2008 + (recent_year + 3 * 28 - 2008) % 28;
184 double time_ms =
static_cast<double>(time_sec * 1000);
191 return static_cast<int>(offset);
200 static const int kDefaultDSTDeltaInSec = 19 *
kSecPerDay;
203 static const int kDSTSize = 32;
216 int DaylightSavingsOffsetInMs(int64_t time_ms);
223 void ProbeDST(
int time_sec);
227 DST* LeastRecentlyUsedDST(DST* skip);
231 inline void ExtendTheAfterSegment(
int time_sec,
int offset_ms);
234 inline void ClearSegment(DST* segment);
236 bool InvalidSegment(DST* segment) {
237 return segment->start_sec > segment->end_sec;
244 int dst_usage_counter_;
248 int local_offset_ms_;
int64_t ToUTC(int64_t time_ms)
static const int kSecPerDay
static const int64_t kMaxTimeBeforeUTCInMs
static const char * LocalTimezone(double time)
static const int64_t kMaxEpochTimeInMs
#define ASSERT(condition)
static const int kInvalidStamp
virtual int GetLocalOffsetFromOS()
const char * LocalTimezone(int64_t time_ms)
int TimezoneOffset(int64_t time_ms)
static const int64_t kMaxTimeInMs
static const int kMaxEpochTimeInSec
static int TimeInDay(int64_t time_ms, int days)
virtual int GetDaylightSavingsOffsetFromOS(int64_t time_sec)
static const int kInvalidLocalOffsetInMs
int DaysFromYearMonth(int year, int month)
static const int64_t kMsPerDay
static const int kMsPerMin
void YearMonthDayFromDays(int days, int *year, int *month, int *day)
static double DaylightSavingsOffset(double time)
int EquivalentYear(int year)
static int DaysFromTime(int64_t time_ms)
static double LocalTimeOffset()
int64_t EquivalentTime(int64_t time_ms)
int64_t ToLocal(int64_t time_ms)