Home
last modified time | relevance | path

Searched refs:year (Results 1 – 25 of 1504) sorted by relevance

12345678910>>...61

/external/libcxx/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.members/
Dok.pass.cpp25 using year = std::chrono::year; in main() typedef
35 static_assert(!year_month_day{year{-32768}, month{}, day{}}.ok(), ""); // All three bad in main()
37 static_assert(!year_month_day{year{-32768}, January, day{1}}.ok(), ""); // Bad year in main()
38 static_assert(!year_month_day{year{2019}, month{}, day{1}}.ok(), ""); // Bad month in main()
39 static_assert(!year_month_day{year{2019}, January, day{} }.ok(), ""); // Bad day in main()
41 static_assert(!year_month_day{year{-32768}, month{}, day{1}}.ok(), ""); // Bad year & month in main()
42 static_assert(!year_month_day{year{2019}, month{}, day{} }.ok(), ""); // Bad month & day in main()
43 static_assert(!year_month_day{year{-32768}, January, day{} }.ok(), ""); // Bad year & day in main()
45 static_assert( year_month_day{year{2019}, January, day{1}}.ok(), ""); // All OK in main()
48 static_assert( year_month_day{year{2020}, month{ 1}, day{31}}.ok(), ""); in main()
[all …]
/external/protobuf/src/google/protobuf/stubs/
Dtime.cc29 int64 SecondsPer100Years(int year) { in SecondsPer100Years() argument
30 if (year % 400 == 0 || year % 400 > 300) { in SecondsPer100Years()
39 int64 SecondsPer4Years(int year) { in SecondsPer4Years() argument
40 if ((year % 100 == 0 || year % 100 > 96) && in SecondsPer4Years()
41 !(year % 400 == 0 || year % 400 > 396)) { in SecondsPer4Years()
50 bool IsLeapYear(int year) { in IsLeapYear() argument
51 return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0); in IsLeapYear()
54 int64 SecondsPerYear(int year) { in SecondsPerYear() argument
55 return kSecondsPerDay * (IsLeapYear(year) ? 366 : 365); in SecondsPerYear()
74 if (time.year < 1 || time.year > 9999 || in ValidateDateTime()
[all …]
/external/libcxx/test/std/utilities/time/time.cal/time.cal.year/time.cal.year.members/
Dis_leap.pass.cpp26 using year = std::chrono::year; in main() typedef
28 ASSERT_NOEXCEPT( year(1).is_leap()); in main()
29 ASSERT_SAME_TYPE(bool, decltype(year(1).is_leap())); in main()
31 static_assert(!year{1}.is_leap(), ""); in main()
32 static_assert(!year{2}.is_leap(), ""); in main()
33 static_assert(!year{3}.is_leap(), ""); in main()
34 static_assert( year{4}.is_leap(), ""); in main()
36 assert( year{-2000}.is_leap()); in main()
37 assert( year{ -400}.is_leap()); in main()
38 assert(!year{ -300}.is_leap()); in main()
[all …]
Dok.pass.cpp30 using year = std::chrono::year; in main() typedef
32 ASSERT_NOEXCEPT( std::declval<const year>().ok()); in main()
33 ASSERT_SAME_TYPE(bool, decltype(std::declval<const year>().ok())); in main()
35 ASSERT_NOEXCEPT( year::max()); in main()
36 ASSERT_SAME_TYPE(year, decltype(year::max())); in main()
38 ASSERT_NOEXCEPT( year::min()); in main()
39 ASSERT_SAME_TYPE(year, decltype(year::min())); in main()
41 static_assert(static_cast<int>(year::min()) == -32767, ""); in main()
42 static_assert(static_cast<int>(year::max()) == 32767, ""); in main()
44 assert(year{-20001}.ok()); in main()
[all …]
Dincrement.pass.cpp36 using year = std::chrono::year; in main() typedef
37 ASSERT_NOEXCEPT(++(std::declval<year&>()) ); in main()
38 ASSERT_NOEXCEPT( (std::declval<year&>())++); in main()
40 ASSERT_SAME_TYPE(year , decltype( std::declval<year&>()++)); in main()
41 ASSERT_SAME_TYPE(year&, decltype(++std::declval<year&>() )); in main()
43 static_assert(testConstexpr<year>(), ""); in main()
47 year year(i); in main() local
48 assert(static_cast<int>(++year) == i + 1); in main()
49 assert(static_cast<int>(year++) == i + 1); in main()
50 assert(static_cast<int>(year) == i + 2); in main()
Ddecrement.pass.cpp36 using year = std::chrono::year; in main() typedef
37 ASSERT_NOEXCEPT(--(std::declval<year&>()) ); in main()
38 ASSERT_NOEXCEPT( (std::declval<year&>())--); in main()
40 ASSERT_SAME_TYPE(year , decltype( std::declval<year&>()--)); in main()
41 ASSERT_SAME_TYPE(year&, decltype(--std::declval<year&>() )); in main()
43 static_assert(testConstexpr<year>(), ""); in main()
47 year year(i); in main() local
48 assert(static_cast<int>(--year) == i - 1); in main()
49 assert(static_cast<int>(year--) == i - 1); in main()
50 assert(static_cast<int>(year) == i - 2); in main()
Dplus_minus_equal.pass.cpp38 using year = std::chrono::year; in main() typedef
41 ASSERT_NOEXCEPT(std::declval<year&>() += std::declval<years>()); in main()
42 ASSERT_NOEXCEPT(std::declval<year&>() -= std::declval<years>()); in main()
44 ASSERT_SAME_TYPE(year&, decltype(std::declval<year&>() += std::declval<years>())); in main()
45 ASSERT_SAME_TYPE(year&, decltype(std::declval<year&>() -= std::declval<years>())); in main()
47 static_assert(testConstexpr<year, years>(), ""); in main()
51 year year(i); in main() local
52 assert(static_cast<int>(year += years{10}) == i + 10); in main()
53 assert(static_cast<int>(year) == i + 10); in main()
54 assert(static_cast<int>(year -= years{ 9}) == i + 1); in main()
[all …]
Dplus_minus.pass.cpp34 using year = std::chrono::year; in main() typedef
36 ASSERT_NOEXCEPT(+std::declval<year>()); in main()
37 ASSERT_NOEXCEPT(-std::declval<year>()); in main()
39 ASSERT_SAME_TYPE(year, decltype(+std::declval<year>())); in main()
40 ASSERT_SAME_TYPE(year, decltype(-std::declval<year>())); in main()
42 static_assert(testConstexpr<year>(), ""); in main()
46 year year(i); in main() local
47 assert(static_cast<int>(+year) == i); in main()
48 assert(static_cast<int>(-year) == -i); in main()
/external/libcxx/test/std/utilities/time/time.cal/time.cal.operators/
Dyear_month_day_last.pass.cpp46 using year = std::chrono::year; in main() typedef
54 constexpr year_month Feb2018{year{2018}, February}; in main()
59 static_assert((Feb2018/last).year() == year{2018}, ""); in main()
65 year y{i}; in main()
68 assert(ymdl.year() == y); in main()
75 ASSERT_NOEXCEPT ( year{2018}/month_day_last{February}); in main()
76 ASSERT_SAME_TYPE(year_month_day_last, decltype(year{2018}/month_day_last{February})); in main()
77 ASSERT_NOEXCEPT ( month_day_last{February}/year{2018}); in main()
78 ASSERT_SAME_TYPE(year_month_day_last, decltype(month_day_last{February}/year{2018})); in main()
80 static_assert((year{2018}/month_day_last{February}).month() == February, ""); in main()
[all …]
Dyear_month_weekday_last.pass.cpp46 using year = std::chrono::year; in main() typedef
57 constexpr year_month Feb2018{year{2018}, February}; in main()
62 static_assert((Feb2018/weekday_last{Tuesday}).year() == year{2018}, ""); in main()
70 year y{i}; in main()
74 assert(ymwdl.year() == y); in main()
84 ASSERT_NOEXCEPT ( year{2018}/FebLastTues); in main()
85 ASSERT_SAME_TYPE(year_month_weekday_last, decltype(year{2018}/FebLastTues)); in main()
86 ASSERT_NOEXCEPT ( FebLastTues/year{2018}); in main()
87 ASSERT_SAME_TYPE(year_month_weekday_last, decltype(FebLastTues/year{2018})); in main()
90 static_assert((year{2018}/FebLastTues).year() == year{2018}, ""); in main()
[all …]
Dyear_month.pass.cpp32 using year = std::chrono::year; in main() typedef
38 ASSERT_NOEXCEPT ( year{2018}/February); in main()
39 ASSERT_SAME_TYPE(year_month, decltype(year{2018}/February)); in main()
41 static_assert((year{2018}/February).year() == year{2018}, ""); in main()
42 static_assert((year{2018}/February).month() == month{2}, ""); in main()
46 year_month ym = year{i}/month{j}; in main()
47 assert(static_cast<int>(ym.year()) == i); in main()
54 ASSERT_NOEXCEPT ( year{2018}/4); in main()
55 ASSERT_SAME_TYPE(year_month, decltype(year{2018}/4)); in main()
57 static_assert((year{2018}/2).year() == year{2018}, ""); in main()
[all …]
Dyear_month_weekday.pass.cpp43 using year = std::chrono::year; in main() typedef
57 constexpr year_month Feb2018{year{2018}, February}; in main()
62 static_assert((Feb2018/weekday_indexed{Tuesday, 2}).year() == year{2018}, "" ); in main()
71 year y(i); in main()
75 assert(ymd.year() == y); in main()
83 ASSERT_NOEXCEPT ( year{2018}/Feb1stTues); in main()
84 ASSERT_SAME_TYPE(year_month_weekday, decltype(year{2018}/Feb1stTues)); in main()
85 ASSERT_NOEXCEPT ( Feb1stTues/year{2018}); in main()
86 ASSERT_SAME_TYPE(year_month_weekday, decltype(Feb1stTues/year{2018})); in main()
88 static_assert((year{2018}/Feb1stTues).year() == year{2018}, "" ); in main()
[all …]
/external/libcxx/test/std/utilities/time/time.cal/time.cal.ymd/time.cal.ymd.nonmembers/
Dcomparisons.pass.cpp36 using year = std::chrono::year; in main() typedef
47 year_month_day{year{1234}, January, day{1}}, in main()
48 year_month_day{year{1234}, January, day{1}}, in main()
53 year_month_day{year{1234}, January, day{1}}, in main()
54 year_month_day{year{1234}, January, day{2}}, in main()
59 year_month_day{year{1234}, January, day{1}}, in main()
60 year_month_day{year{1234}, February, day{1}}, in main()
65 year_month_day{year{1234}, January, day{1}}, in main()
66 year_month_day{year{1235}, January, day{1}}, in main()
72 year_month_day{year{1234}, January, day{2}}, in main()
[all …]
/external/python/cpython2/Demo/classes/
DDates.py62 def _is_leap(year): # 1 if leap year, else 0 argument
63 if year % 4 != 0: return 0
64 if year % 400 == 0: return 1
65 return year % 100 != 0
67 def _days_in_year(year): # number of days in year argument
68 return 365 + _is_leap(year)
70 def _days_before_year(year): # number of days before year argument
71 return year*365L + (year+3)//4 - (year+99)//100 + (year+399)//400
73 def _days_in_month(month, year): # number of days in month of year argument
74 if month == 2 and _is_leap(year): return 29
[all …]
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/util/
DHebrewCalendar.java363 public HebrewCalendar(int year, int month, int date) { in HebrewCalendar() argument
365 this.set(YEAR, year); in HebrewCalendar()
402 public HebrewCalendar(int year, int month, int date, int hour, in HebrewCalendar() argument
406 this.set(YEAR, year); in HebrewCalendar()
459 int year = get(YEAR); in add() local
465 if (acrossAdar1 && month>=ADAR_1 && !isLeapYear(year)) { in add()
472 ++year; in add()
479 if (acrossAdar1 && month<=ADAR_1 && !isLeapYear(year)) { in add()
486 --year; in add()
491 set(YEAR, year); in add()
[all …]
DIndianCalendar.java256 public IndianCalendar(int year, int month, int date) { in IndianCalendar() argument
258 this.set(Calendar.YEAR, year); in IndianCalendar()
283 public IndianCalendar(int year, int month, int date, int hour, in IndianCalendar() argument
287 this.set(Calendar.YEAR, year); in IndianCalendar()
313 int year; in handleGetExtendedYear() local
316 year = internalGet(EXTENDED_YEAR, 1); in handleGetExtendedYear()
319 year = internalGet(YEAR, 1); in handleGetExtendedYear()
322 return year; in handleGetExtendedYear()
442 protected int handleComputeMonthStart(int year, int month, boolean useMonth) { in handleComputeMonthStart() argument
449 year += month / 12; in handleComputeMonthStart()
[all …]
/external/icu/android_icu4j/src/main/java/android/icu/util/
DHebrewCalendar.java343 public HebrewCalendar(int year, int month, int date) { in HebrewCalendar() argument
345 this.set(YEAR, year); in HebrewCalendar()
380 public HebrewCalendar(int year, int month, int date, int hour, in HebrewCalendar() argument
384 this.set(YEAR, year); in HebrewCalendar()
436 int year = get(YEAR); in add() local
442 if (acrossAdar1 && month>=ADAR_1 && !isLeapYear(year)) { in add()
449 ++year; in add()
456 if (acrossAdar1 && month<=ADAR_1 && !isLeapYear(year)) { in add()
463 --year; in add()
468 set(YEAR, year); in add()
[all …]
DIndianCalendar.java234 public IndianCalendar(int year, int month, int date) { in IndianCalendar() argument
236 this.set(Calendar.YEAR, year); in IndianCalendar()
260 public IndianCalendar(int year, int month, int date, int hour, in IndianCalendar() argument
264 this.set(Calendar.YEAR, year); in IndianCalendar()
289 int year; in handleGetExtendedYear() local
292 year = internalGet(EXTENDED_YEAR, 1); in handleGetExtendedYear()
295 year = internalGet(YEAR, 1); in handleGetExtendedYear()
298 return year; in handleGetExtendedYear()
413 protected int handleComputeMonthStart(int year, int month, boolean useMonth) { in handleComputeMonthStart() argument
420 year += month / 12; in handleComputeMonthStart()
[all …]
/external/libcxx/test/std/utilities/time/time.cal/time.cal.ymwd/time.cal.ymwd.nonmembers/
Dcomparisons.pass.cpp28 using year = std::chrono::year; in main() typedef
42 year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}}, in main()
43 year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}}, in main()
48 year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}}, in main()
49 year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 2}}, in main()
54 year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}}, in main()
55 year_month_weekday{year{1234}, February, weekday_indexed{Tuesday, 1}}, in main()
60 year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}}, in main()
61 year_month_weekday{year{1235}, January, weekday_indexed{Tuesday, 1}}, in main()
67 year_month_weekday{year{1234}, January, weekday_indexed{Tuesday, 1}}, in main()
[all …]
/external/libcxx/test/std/utilities/time/time.cal/time.cal.ymwdlast/time.cal.ymwdlast.nonmembers/
Dcomparisons.pass.cpp28 using year = std::chrono::year; in main() typedef
43 year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}}, in main()
44 year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}}, in main()
49 year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}}, in main()
50 year_month_weekday_last{year{1234}, January, weekday_last{Wednesday}}, in main()
55 year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}}, in main()
56 year_month_weekday_last{year{1234}, February, weekday_last{Tuesday}}, in main()
61 year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}}, in main()
62 year_month_weekday_last{year{1235}, January, weekday_last{Tuesday}}, in main()
68 year_month_weekday_last{year{1234}, January, weekday_last{Tuesday}}, in main()
[all …]
/external/python/cpython2/Demo/scripts/
Dunbirthday.py14 year = int(sys.argv[1])
16 year = int(raw_input('In which year were you born? '))
17 if 0 <= year < 100:
18 print "I'll assume that by", year,
19 year = year + 1900
20 print 'you mean', year, 'and not the early Christian era'
21 elif not (1850 <= year <= time.localtime()[0]):
22 print "It's hard to believe you were born in", year
37 if month == 2 and calendar.isleap(year):
45 bdaytuple = (year, month, day)
[all …]
/external/libcxx/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.members/
Dday.pass.cpp25 using year = std::chrono::year; in main() typedef
35 static_assert( year_month_day_last{year{2020}, month_day_last{month{ 1}}}.day() == day{31}, ""); in main()
36 static_assert( year_month_day_last{year{2020}, month_day_last{month{ 2}}}.day() == day{29}, ""); in main()
37 static_assert( year_month_day_last{year{2020}, month_day_last{month{ 3}}}.day() == day{31}, ""); in main()
38 static_assert( year_month_day_last{year{2020}, month_day_last{month{ 4}}}.day() == day{30}, ""); in main()
39 static_assert( year_month_day_last{year{2020}, month_day_last{month{ 5}}}.day() == day{31}, ""); in main()
40 static_assert( year_month_day_last{year{2020}, month_day_last{month{ 6}}}.day() == day{30}, ""); in main()
41 static_assert( year_month_day_last{year{2020}, month_day_last{month{ 7}}}.day() == day{31}, ""); in main()
42 static_assert( year_month_day_last{year{2020}, month_day_last{month{ 8}}}.day() == day{31}, ""); in main()
43 static_assert( year_month_day_last{year{2020}, month_day_last{month{ 9}}}.day() == day{30}, ""); in main()
[all …]
/external/libcxx/test/std/utilities/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/
Dcomparisons.pass.cpp32 using year = std::chrono::year; in main() typedef
44 year_month_day_last{year{1234}, month_day_last{January}}, in main()
45 year_month_day_last{year{1234}, month_day_last{January}}, in main()
50 year_month_day_last{year{1234}, month_day_last{January}}, in main()
51 year_month_day_last{year{1234}, month_day_last{February}}, in main()
56 year_month_day_last{year{1234}, month_day_last{January}}, in main()
57 year_month_day_last{year{1235}, month_day_last{January}}, in main()
62 year_month_day_last{year{1234}, month_day_last{January}}, in main()
63 year_month_day_last{year{1234}, month_day_last{February}}, in main()
68 year_month_day_last{year{1234}, month_day_last{February}}, in main()
[all …]
/external/pdfium/fxjs/
DJS_Define.cpp56 bool IsLeapYear(int year) { in IsLeapYear() argument
57 return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 != 0)); in IsLeapYear()
97 int year = YearFromTime(t); in DayWithinYear() local
99 return day - DayFromYear(year); in DayWithinYear()
104 int year = YearFromTime(t); in MonthFromTime() local
107 if (31 <= day && day < 59 + IsLeapYear(year)) in MonthFromTime()
109 if ((59 + IsLeapYear(year)) <= day && day < (90 + IsLeapYear(year))) in MonthFromTime()
111 if ((90 + IsLeapYear(year)) <= day && day < (120 + IsLeapYear(year))) in MonthFromTime()
113 if ((120 + IsLeapYear(year)) <= day && day < (151 + IsLeapYear(year))) in MonthFromTime()
115 if ((151 + IsLeapYear(year)) <= day && day < (181 + IsLeapYear(year))) in MonthFromTime()
[all …]
/external/icu/icu4c/source/i18n/
Dhebrwcal.cpp228 int32_t year = get(UCAL_YEAR, status); in add() local
234 if (acrossAdar1 && month>=ADAR_1 && !isLeapYear(year)) { in add()
241 ++year; in add()
248 if (acrossAdar1 && month<=ADAR_1 && !isLeapYear(year)) { in add()
255 --year; in add()
260 set(UCAL_YEAR, year); in add()
320 int32_t year = get(UCAL_YEAR, status); in roll() local
322 UBool leapYear = isLeapYear(year); in roll()
323 int32_t yearLength = monthsInYear(year); in roll()
390 int32_t HebrewCalendar::startOfYear(int32_t year, UErrorCode &status) in startOfYear() argument
[all …]

12345678910>>...61