#include "src/date/date.h"
#include <limits>
#include "src/base/overflowing-math.h"
#include "src/date/dateparser-inl.h"
#include "src/numbers/conversions.h"
#include "src/objects/objects-inl.h"
#ifdef V8_INTL_SUPPORT
#include "src/objects/intl-objects.h"
#endif
#include "src/strings/string-stream.h"
namespace v8 {
namespace internal {
static const int kDaysIn4Years = …;
static const int kDaysIn100Years = …;
static const int kDaysIn400Years = …;
static const int kDays1970to2000 = …;
static const int kDaysOffset = …;
static const int kYearsOffset = …;
static const char kDaysInMonths[] = …;
DateCache::DateCache()
: … { … }
void DateCache::ResetDateCache(
base::TimezoneCache::TimeZoneDetection time_zone_detection) { … }
void DateCache::ClearSegment(DST* segment) { … }
void DateCache::YearMonthDayFromDays(int days, int* year, int* month,
int* day) { … }
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 DateCache::GetLocalOffsetFromOS(int64_t time_ms, bool is_utc) { … }
void DateCache::ExtendTheAfterSegment(int time_sec, int offset_ms) { … }
int DateCache::DaylightSavingsOffsetInMs(int64_t time_ms) { … }
void DateCache::ProbeDST(int time_sec) { … }
DateCache::DST* DateCache::LeastRecentlyUsedDST(DST* skip) { … }
namespace {
const double kMinYear = …;
const double kMaxYear = …;
const double kMinMonth = …;
const double kMaxMonth = …;
const double kMsPerDay = …;
const double kMsPerSecond = …;
const double kMsPerMinute = …;
const double kMsPerHour = …;
}
double MakeDate(double day, double time) { … }
double MakeDay(double year, double month, double date) { … }
double MakeTime(double hour, double min, double sec, double ms) { … }
namespace {
const char* kShortWeekDays[] = …;
const char* kShortMonths[] = …;
template <class... Args>
DateBuffer FormatDate(const char* format, Args... args) { … }
}
DateBuffer ToDateString(double time_val, DateCache* date_cache,
ToDateStringMode mode) { … }
double ParseDateTimeString(Isolate* isolate, Handle<String> str) { … }
}
}