Lines Matching refs:Date
427 @property void date(in Date date) @safe pure nothrow @nogc in opCmp()
435 dt.date = Date(1999, 7, 6);
436 assert(dt._date == Date(1999, 7, 6));
441 static assert(!__traits(compiles, cdt.date = Date(2010, 1, 1)));
442 static assert(!__traits(compiles, idt.date = Date(2010, 1, 1)));
462 auto dt = DateTime(Date.init, TimeOfDay(12, 30, 33));
540 assert(DateTime(Date(1999, 7, 6), TimeOfDay(9, 7, 5)).year == 1999);
541 assert(DateTime(Date(2010, 10, 4), TimeOfDay(0, 0, 30)).year == 2010);
542 assert(DateTime(Date(-7, 4, 5), TimeOfDay(7, 45, 2)).year == -7);
553 testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)),
555 DateTime(Date(1999, 1, 1), TimeOfDay(12, 30, 33)));
556 testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)),
558 DateTime(Date(0, 1, 1), TimeOfDay(12, 30, 33)));
559 testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)),
561 DateTime(Date(-1999, 1, 1), TimeOfDay(12, 30, 33)));
584 assert(DateTime(Date(0, 1, 1), TimeOfDay(12, 30, 33)).yearBC == 1);
585 assert(DateTime(Date(-1, 1, 1), TimeOfDay(10, 7, 2)).yearBC == 2);
586 assert(DateTime(Date(-100, 1, 1), TimeOfDay(4, 59, 0)).yearBC == 101);
591 assertThrown!DateTimeException((in DateTime dt){dt.yearBC;}(DateTime(Date(1, 1, 1))));
696 …assertThrown!DateTimeException(testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)), cast(Month) …
697 …assertThrown!DateTimeException(testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)), cast(Month) …
699 testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)),
701 DateTime(Date(1, 7, 1), TimeOfDay(12, 30, 33)));
702 testDT(DateTime(Date(-1, 1, 1), TimeOfDay(12, 30, 33)),
704 DateTime(Date(-1, 7, 1), TimeOfDay(12, 30, 33)));
724 assert(DateTime(Date(1999, 7, 6), TimeOfDay(9, 7, 5)).day == 6);
725 assert(DateTime(Date(2010, 10, 4), TimeOfDay(0, 0, 30)).day == 4);
726 assert(DateTime(Date(-7, 4, 5), TimeOfDay(7, 45, 2)).day == 5);
744 test(DateTime(Date(year, md.month, md.day), tod), md.day);
893 … assertThrown!DateTimeException((){DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 0)).hour = 24;}());
2388 auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2389 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2390 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2415 auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2416 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2417 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2434 auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2435 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2436 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2454 assert(DateTime(Date(1999, 1, 1), TimeOfDay(12, 22, 7)).dayOfYear == 1);
2455 assert(DateTime(Date(1999, 12, 31), TimeOfDay(7, 2, 59)).dayOfYear == 365);
2456 assert(DateTime(Date(2000, 12, 31), TimeOfDay(21, 20, 0)).dayOfYear == 366);
2461 auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2462 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2463 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2484 auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2485 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2486 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2505 assert(DateTime(Date(1, 1, 1), TimeOfDay(0, 0, 0)).dayOfGregorianCal == 1);
2506 assert(DateTime(Date(1, 12, 31), TimeOfDay(23, 59, 59)).dayOfGregorianCal == 365);
2507 assert(DateTime(Date(2, 1, 1), TimeOfDay(2, 2, 2)).dayOfGregorianCal == 366);
2509 assert(DateTime(Date(0, 12, 31), TimeOfDay(7, 7, 7)).dayOfGregorianCal == 0);
2510 assert(DateTime(Date(0, 1, 1), TimeOfDay(19, 30, 0)).dayOfGregorianCal == -365);
2511 assert(DateTime(Date(-1, 12, 31), TimeOfDay(4, 7, 0)).dayOfGregorianCal == -366);
2513 assert(DateTime(Date(2000, 1, 1), TimeOfDay(9, 30, 20)).dayOfGregorianCal == 730_120);
2514 assert(DateTime(Date(2010, 12, 31), TimeOfDay(15, 45, 50)).dayOfGregorianCal == 734_137);
2519 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2520 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2543 auto dt = DateTime(Date.init, TimeOfDay(12, 0, 0));
2545 assert(dt == DateTime(Date(1, 1, 1), TimeOfDay(12, 0, 0)));
2548 assert(dt == DateTime(Date(1, 12, 31), TimeOfDay(12, 0, 0)));
2551 assert(dt == DateTime(Date(2, 1, 1), TimeOfDay(12, 0, 0)));
2554 assert(dt == DateTime(Date(0, 12, 31), TimeOfDay(12, 0, 0)));
2557 assert(dt == DateTime(Date(-0, 1, 1), TimeOfDay(12, 0, 0)));
2560 assert(dt == DateTime(Date(-1, 12, 31), TimeOfDay(12, 0, 0)));
2563 assert(dt == DateTime(Date(2000, 1, 1), TimeOfDay(12, 0, 0)));
2566 assert(dt == DateTime(Date(2010, 12, 31), TimeOfDay(12, 0, 0)));
2571 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2572 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2582 $(HTTP en.wikipedia.org/wiki/ISO_week_date, ISO Week Date)
2591 auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2592 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2593 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2616 assert(DateTime(Date(1999, 1, 6), TimeOfDay(0, 0, 0)).endOfMonth ==
2617 DateTime(Date(1999, 1, 31), TimeOfDay(23, 59, 59)));
2619 assert(DateTime(Date(1999, 2, 7), TimeOfDay(19, 30, 0)).endOfMonth ==
2620 DateTime(Date(1999, 2, 28), TimeOfDay(23, 59, 59)));
2622 assert(DateTime(Date(2000, 2, 7), TimeOfDay(5, 12, 27)).endOfMonth ==
2623 DateTime(Date(2000, 2, 29), TimeOfDay(23, 59, 59)));
2625 assert(DateTime(Date(2000, 6, 4), TimeOfDay(12, 22, 9)).endOfMonth ==
2626 DateTime(Date(2000, 6, 30), TimeOfDay(23, 59, 59)));
2661 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2662 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2679 assert(DateTime(Date(1999, 1, 6), TimeOfDay(0, 0, 0)).daysInMonth == 31);
2680 assert(DateTime(Date(1999, 2, 7), TimeOfDay(19, 30, 0)).daysInMonth == 28);
2681 assert(DateTime(Date(2000, 2, 7), TimeOfDay(5, 12, 27)).daysInMonth == 29);
2682 assert(DateTime(Date(2000, 6, 4), TimeOfDay(12, 22, 9)).daysInMonth == 30);
2687 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2688 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2705 assert(DateTime(Date(1, 1, 1), TimeOfDay(12, 7, 0)).isAD);
2706 assert(DateTime(Date(2010, 12, 31), TimeOfDay(0, 0, 0)).isAD);
2707 assert(!DateTime(Date(0, 12, 31), TimeOfDay(23, 59, 59)).isAD);
2708 assert(!DateTime(Date(-2010, 1, 1), TimeOfDay(2, 2, 2)).isAD);
2713 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2714 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2737 assert(DateTime(Date(-4713, 11, 24), TimeOfDay(0, 0, 0)).julianDay == -1);
2738 assert(DateTime(Date(-4713, 11, 24), TimeOfDay(12, 0, 0)).julianDay == 0);
2740 assert(DateTime(Date(0, 12, 31), TimeOfDay(0, 0, 0)).julianDay == 1_721_424);
2741 assert(DateTime(Date(0, 12, 31), TimeOfDay(12, 0, 0)).julianDay == 1_721_425);
2743 assert(DateTime(Date(1, 1, 1), TimeOfDay(0, 0, 0)).julianDay == 1_721_425);
2744 assert(DateTime(Date(1, 1, 1), TimeOfDay(12, 0, 0)).julianDay == 1_721_426);
2746 assert(DateTime(Date(1582, 10, 15), TimeOfDay(0, 0, 0)).julianDay == 2_299_160);
2747 assert(DateTime(Date(1582, 10, 15), TimeOfDay(12, 0, 0)).julianDay == 2_299_161);
2749 assert(DateTime(Date(1858, 11, 17), TimeOfDay(0, 0, 0)).julianDay == 2_400_000);
2750 assert(DateTime(Date(1858, 11, 17), TimeOfDay(12, 0, 0)).julianDay == 2_400_001);
2752 assert(DateTime(Date(1982, 1, 4), TimeOfDay(0, 0, 0)).julianDay == 2_444_973);
2753 assert(DateTime(Date(1982, 1, 4), TimeOfDay(12, 0, 0)).julianDay == 2_444_974);
2755 assert(DateTime(Date(1996, 3, 31), TimeOfDay(0, 0, 0)).julianDay == 2_450_173);
2756 assert(DateTime(Date(1996, 3, 31), TimeOfDay(12, 0, 0)).julianDay == 2_450_174);
2758 assert(DateTime(Date(2010, 8, 24), TimeOfDay(0, 0, 0)).julianDay == 2_455_432);
2759 assert(DateTime(Date(2010, 8, 24), TimeOfDay(12, 0, 0)).julianDay == 2_455_433);
2761 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2762 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2779 assert(DateTime(Date(1858, 11, 17), TimeOfDay(0, 0, 0)).modJulianDay == 0);
2780 assert(DateTime(Date(1858, 11, 17), TimeOfDay(12, 0, 0)).modJulianDay == 0);
2782 assert(DateTime(Date(2010, 8, 24), TimeOfDay(0, 0, 0)).modJulianDay == 55_432);
2783 assert(DateTime(Date(2010, 8, 24), TimeOfDay(12, 0, 0)).modJulianDay == 55_432);
2785 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2786 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
2816 assert(DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)).toISOString() ==
2819 assert(DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)).toISOString() ==
2822 assert(DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)).toISOString() ==
2825 assert(DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)).toISOString() ==
2832 assert(DateTime(Date(9, 12, 4), TimeOfDay(0, 0, 0)).toISOString() == "00091204T000000");
2833 assert(DateTime(Date(99, 12, 4), TimeOfDay(5, 6, 12)).toISOString() == "00991204T050612");
2834 … assert(DateTime(Date(999, 12, 4), TimeOfDay(13, 44, 59)).toISOString() == "09991204T134459");
2835 … assert(DateTime(Date(9999, 7, 4), TimeOfDay(23, 59, 59)).toISOString() == "99990704T235959");
2836 … assert(DateTime(Date(10000, 10, 20), TimeOfDay(1, 1, 1)).toISOString() == "+100001020T010101");
2839 assert(DateTime(Date(0, 12, 4), TimeOfDay(0, 12, 4)).toISOString() == "00001204T001204");
2840 assert(DateTime(Date(-9, 12, 4), TimeOfDay(0, 0, 0)).toISOString() == "-00091204T000000");
2841 assert(DateTime(Date(-99, 12, 4), TimeOfDay(5, 6, 12)).toISOString() == "-00991204T050612");
2842 … assert(DateTime(Date(-999, 12, 4), TimeOfDay(13, 44, 59)).toISOString() == "-09991204T134459");
2843 … assert(DateTime(Date(-9999, 7, 4), TimeOfDay(23, 59, 59)).toISOString() == "-99990704T235959");
2844 … assert(DateTime(Date(-10000, 10, 20), TimeOfDay(1, 1, 1)).toISOString() == "-100001020T010101");
2878 assert(DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)).toISOExtString() ==
2881 assert(DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)).toISOExtString() ==
2884 assert(DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)).toISOExtString() ==
2887 assert(DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)).toISOExtString() ==
2894 … assert(DateTime(Date(9, 12, 4), TimeOfDay(0, 0, 0)).toISOExtString() == "0009-12-04T00:00:00");
2895 … assert(DateTime(Date(99, 12, 4), TimeOfDay(5, 6, 12)).toISOExtString() == "0099-12-04T05:06:12");
2896 …assert(DateTime(Date(999, 12, 4), TimeOfDay(13, 44, 59)).toISOExtString() == "0999-12-04T13:44:59"…
2897 …assert(DateTime(Date(9999, 7, 4), TimeOfDay(23, 59, 59)).toISOExtString() == "9999-07-04T23:59:59"…
2898 …assert(DateTime(Date(10000, 10, 20), TimeOfDay(1, 1, 1)).toISOExtString() == "+10000-10-20T01:01:0…
2901 … assert(DateTime(Date(0, 12, 4), TimeOfDay(0, 12, 4)).toISOExtString() == "0000-12-04T00:12:04");
2902 … assert(DateTime(Date(-9, 12, 4), TimeOfDay(0, 0, 0)).toISOExtString() == "-0009-12-04T00:00:00");
2903 …assert(DateTime(Date(-99, 12, 4), TimeOfDay(5, 6, 12)).toISOExtString() == "-0099-12-04T05:06:12");
2904 …assert(DateTime(Date(-999, 12, 4), TimeOfDay(13, 44, 59)).toISOExtString() == "-0999-12-04T13:44:5…
2905 …assert(DateTime(Date(-9999, 7, 4), TimeOfDay(23, 59, 59)).toISOExtString() == "-9999-07-04T23:59:5…
2906 …assert(DateTime(Date(-10000, 10, 20), TimeOfDay(1, 1, 1)).toISOExtString() == "-10000-10-20T01:01:…
2939 assert(DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)).toSimpleString() ==
2942 assert(DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)).toSimpleString() ==
2945 assert(DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)).toSimpleString() ==
2948 assert(DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)).toSimpleString() ==
2955 … assert(DateTime(Date(9, 12, 4), TimeOfDay(0, 0, 0)).toSimpleString() == "0009-Dec-04 00:00:00");
2956 … assert(DateTime(Date(99, 12, 4), TimeOfDay(5, 6, 12)).toSimpleString() == "0099-Dec-04 05:06:12");
2957 …assert(DateTime(Date(999, 12, 4), TimeOfDay(13, 44, 59)).toSimpleString() == "0999-Dec-04 13:44:59…
2958 …assert(DateTime(Date(9999, 7, 4), TimeOfDay(23, 59, 59)).toSimpleString() == "9999-Jul-04 23:59:59…
2959 …assert(DateTime(Date(10000, 10, 20), TimeOfDay(1, 1, 1)).toSimpleString() == "+10000-Oct-20 01:01:…
2962 … assert(DateTime(Date(0, 12, 4), TimeOfDay(0, 12, 4)).toSimpleString() == "0000-Dec-04 00:12:04");
2963 … assert(DateTime(Date(-9, 12, 4), TimeOfDay(0, 0, 0)).toSimpleString() == "-0009-Dec-04 00:00:00");
2964 …assert(DateTime(Date(-99, 12, 4), TimeOfDay(5, 6, 12)).toSimpleString() == "-0099-Dec-04 05:06:12"…
2965 …assert(DateTime(Date(-999, 12, 4), TimeOfDay(13, 44, 59)).toSimpleString() == "-0999-Dec-04 13:44:…
2966 …assert(DateTime(Date(-9999, 7, 4), TimeOfDay(23, 59, 59)).toSimpleString() == "-9999-Jul-04 23:59:…
2967 …assert(DateTime(Date(-10000, 10, 20), TimeOfDay(1, 1, 1)).toSimpleString() == "-10000-Oct-20 01:01…
3006 auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
3007 const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
3008 immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
3043 immutable date = Date.fromISOString(str[0 .. t]);
3053 DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
3056 DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)));
3059 DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)));
3062 DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)));
3065 DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
3093 …assert(DateTime.fromISOString("20101222T172201") == DateTime(Date(2010, 12, 22), TimeOfDay(17, 22,…
3094 …assert(DateTime.fromISOString("19990706T123033") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 3…
3095 …assert(DateTime.fromISOString("-19990706T123033") == DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30,…
3096 …assert(DateTime.fromISOString("+019990706T123033") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30,…
3097 …assert(DateTime.fromISOString("19990706T123033 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, …
3098 …assert(DateTime.fromISOString(" 19990706T123033") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, …
3099 …assert(DateTime.fromISOString(" 19990706T123033 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30,…
3143 immutable date = Date.fromISOExtString(str[0 .. t]);
3153 DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
3156 DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)));
3159 DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)));
3162 DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)));
3165 DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
3192 …assert(DateTime.fromISOExtString("2010-12-22T17:22:01") == DateTime(Date(2010, 12, 22), TimeOfDay(…
3193 …assert(DateTime.fromISOExtString("1999-07-06T12:30:33") == DateTime(Date(1999, 7, 6), TimeOfDay(12…
3194 …assert(DateTime.fromISOExtString("-1999-07-06T12:30:33") == DateTime(Date(-1999, 7, 6), TimeOfDay(…
3195 …assert(DateTime.fromISOExtString("+01999-07-06T12:30:33") == DateTime(Date(1999, 7, 6), TimeOfDay(…
3196 …assert(DateTime.fromISOExtString("1999-07-06T12:30:33 ") == DateTime(Date(1999, 7, 6), TimeOfDay(1…
3197 …assert(DateTime.fromISOExtString(" 1999-07-06T12:30:33") == DateTime(Date(1999, 7, 6), TimeOfDay(1…
3198 …assert(DateTime.fromISOExtString(" 1999-07-06T12:30:33 ") == DateTime(Date(1999, 7, 6), TimeOfDay(…
3242 immutable date = Date.fromSimpleString(str[0 .. t]);
3252 DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
3254 DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)));
3256 DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)));
3258 DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)));
3260 DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
3289 DateTime(Date(2010, 12, 22), TimeOfDay(17, 22, 01)));
3291 DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
3293 DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
3295 DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
3297 DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
3299 DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
3301 DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
3324 assert(result._date == Date.min); in min()
3351 assert(result._date == Date.max); in max()
3584 Date _date;
3595 Year, month, and day are kept separately internally so that $(D Date) is
3598 $(D Date) uses the Proleptic Gregorian Calendar, so it assumes the Gregorian
3606 struct Date
3613 $(LREF Date) would not be valid.
3635 assert(Date(1, 1, 1) == Date.init);
3637 static void testDate(in Date date, int year, int month, int day) in testDate()
3644 testDate(Date(1999, 1 , 1), 1999, Month.jan, 1);
3645 testDate(Date(1999, 7 , 1), 1999, Month.jul, 1);
3646 testDate(Date(1999, 7 , 6), 1999, Month.jul, 6);
3649 assertThrown!DateTimeException(Date(1, 0, 1));
3650 assertThrown!DateTimeException(Date(1, 1, 0));
3651 assertThrown!DateTimeException(Date(1999, 13, 1));
3652 assertThrown!DateTimeException(Date(1999, 1, 32));
3653 assertThrown!DateTimeException(Date(1999, 2, 29));
3654 assertThrown!DateTimeException(Date(2000, 2, 30));
3655 assertThrown!DateTimeException(Date(1999, 3, 32));
3656 assertThrown!DateTimeException(Date(1999, 4, 31));
3657 assertThrown!DateTimeException(Date(1999, 5, 32));
3658 assertThrown!DateTimeException(Date(1999, 6, 31));
3659 assertThrown!DateTimeException(Date(1999, 7, 32));
3660 assertThrown!DateTimeException(Date(1999, 8, 32));
3661 assertThrown!DateTimeException(Date(1999, 9, 31));
3662 assertThrown!DateTimeException(Date(1999, 10, 32));
3663 assertThrown!DateTimeException(Date(1999, 11, 31));
3664 assertThrown!DateTimeException(Date(1999, 12, 32));
3666 assertNotThrown!DateTimeException(Date(1999, 1, 31));
3667 assertNotThrown!DateTimeException(Date(1999, 2, 28));
3668 assertNotThrown!DateTimeException(Date(2000, 2, 29));
3669 assertNotThrown!DateTimeException(Date(1999, 3, 31));
3670 assertNotThrown!DateTimeException(Date(1999, 4, 30));
3671 assertNotThrown!DateTimeException(Date(1999, 5, 31));
3672 assertNotThrown!DateTimeException(Date(1999, 6, 30));
3673 assertNotThrown!DateTimeException(Date(1999, 7, 31));
3674 assertNotThrown!DateTimeException(Date(1999, 8, 31));
3675 assertNotThrown!DateTimeException(Date(1999, 9, 30));
3676 assertNotThrown!DateTimeException(Date(1999, 10, 31));
3677 assertNotThrown!DateTimeException(Date(1999, 11, 30));
3678 assertNotThrown!DateTimeException(Date(1999, 12, 31));
3681 assertNotThrown!DateTimeException(Date(0, 1, 1));
3682 assertNotThrown!DateTimeException(Date(-1, 1, 1));
3683 assertNotThrown!DateTimeException(Date(-1, 12, 31));
3684 assertNotThrown!DateTimeException(Date(-1, 2, 28));
3685 assertNotThrown!DateTimeException(Date(-4, 2, 29));
3687 assertThrown!DateTimeException(Date(-1, 2, 29));
3688 assertThrown!DateTimeException(Date(-2, 2, 29));
3689 assertThrown!DateTimeException(Date(-3, 2, 29));
3696 $(LREF Date) will be for.
3818 assert(Date(gd.day) == gd.date);
3823 Compares this $(LREF Date) with the given $(LREF Date).
3832 int opCmp(in Date rhs) const @safe pure nothrow @nogc in opCmp()
3855 assert(Date(1, 1, 1).opCmp(Date.init) == 0);
3857 assert(Date(1999, 1, 1).opCmp(Date(1999, 1, 1)) == 0);
3858 assert(Date(1, 7, 1).opCmp(Date(1, 7, 1)) == 0);
3859 assert(Date(1, 1, 6).opCmp(Date(1, 1, 6)) == 0);
3861 assert(Date(1999, 7, 1).opCmp(Date(1999, 7, 1)) == 0);
3862 assert(Date(1999, 7, 6).opCmp(Date(1999, 7, 6)) == 0);
3864 assert(Date(1, 7, 6).opCmp(Date(1, 7, 6)) == 0);
3866 assert(Date(1999, 7, 6).opCmp(Date(2000, 7, 6)) < 0);
3867 assert(Date(2000, 7, 6).opCmp(Date(1999, 7, 6)) > 0);
3868 assert(Date(1999, 7, 6).opCmp(Date(1999, 8, 6)) < 0);
3869 assert(Date(1999, 8, 6).opCmp(Date(1999, 7, 6)) > 0);
3870 assert(Date(1999, 7, 6).opCmp(Date(1999, 7, 7)) < 0);
3871 assert(Date(1999, 7, 7).opCmp(Date(1999, 7, 6)) > 0);
3873 assert(Date(1999, 8, 7).opCmp(Date(2000, 7, 6)) < 0);
3874 assert(Date(2000, 8, 6).opCmp(Date(1999, 7, 7)) > 0);
3875 assert(Date(1999, 7, 7).opCmp(Date(2000, 7, 6)) < 0);
3876 assert(Date(2000, 7, 6).opCmp(Date(1999, 7, 7)) > 0);
3877 assert(Date(1999, 7, 7).opCmp(Date(1999, 8, 6)) < 0);
3878 assert(Date(1999, 8, 6).opCmp(Date(1999, 7, 7)) > 0);
3881 assert(Date(0, 1, 1).opCmp(Date(0, 1, 1)) == 0);
3882 assert(Date(-1, 1, 1).opCmp(Date(-1, 1, 1)) == 0);
3883 assert(Date(-1, 7, 1).opCmp(Date(-1, 7, 1)) == 0);
3884 assert(Date(-1, 1, 6).opCmp(Date(-1, 1, 6)) == 0);
3886 assert(Date(-1999, 7, 1).opCmp(Date(-1999, 7, 1)) == 0);
3887 assert(Date(-1999, 7, 6).opCmp(Date(-1999, 7, 6)) == 0);
3889 assert(Date(-1, 7, 6).opCmp(Date(-1, 7, 6)) == 0);
3891 assert(Date(-2000, 7, 6).opCmp(Date(-1999, 7, 6)) < 0);
3892 assert(Date(-1999, 7, 6).opCmp(Date(-2000, 7, 6)) > 0);
3893 assert(Date(-1999, 7, 6).opCmp(Date(-1999, 8, 6)) < 0);
3894 assert(Date(-1999, 8, 6).opCmp(Date(-1999, 7, 6)) > 0);
3895 assert(Date(-1999, 7, 6).opCmp(Date(-1999, 7, 7)) < 0);
3896 assert(Date(-1999, 7, 7).opCmp(Date(-1999, 7, 6)) > 0);
3898 assert(Date(-2000, 8, 6).opCmp(Date(-1999, 7, 7)) < 0);
3899 assert(Date(-1999, 8, 7).opCmp(Date(-2000, 7, 6)) > 0);
3900 assert(Date(-2000, 7, 6).opCmp(Date(-1999, 7, 7)) < 0);
3901 assert(Date(-1999, 7, 7).opCmp(Date(-2000, 7, 6)) > 0);
3902 assert(Date(-1999, 7, 7).opCmp(Date(-1999, 8, 6)) < 0);
3903 assert(Date(-1999, 8, 6).opCmp(Date(-1999, 7, 7)) > 0);
3906 assert(Date(-1999, 7, 6).opCmp(Date(1999, 7, 6)) < 0);
3907 assert(Date(1999, 7, 6).opCmp(Date(-1999, 7, 6)) > 0);
3909 assert(Date(-1999, 8, 6).opCmp(Date(1999, 7, 6)) < 0);
3910 assert(Date(1999, 7, 6).opCmp(Date(-1999, 8, 6)) > 0);
3912 assert(Date(-1999, 7, 7).opCmp(Date(1999, 7, 6)) < 0);
3913 assert(Date(1999, 7, 6).opCmp(Date(-1999, 7, 7)) > 0);
3915 assert(Date(-1999, 8, 7).opCmp(Date(1999, 7, 6)) < 0);
3916 assert(Date(1999, 7, 6).opCmp(Date(-1999, 8, 7)) > 0);
3918 assert(Date(-1999, 8, 6).opCmp(Date(1999, 6, 6)) < 0);
3919 assert(Date(1999, 6, 8).opCmp(Date(-1999, 7, 6)) > 0);
3921 auto date = Date(1999, 7, 6);
3922 const cdate = Date(1999, 7, 6);
3923 immutable idate = Date(1999, 7, 6);
3948 assert(Date(1999, 7, 6).year == 1999);
3949 assert(Date(2010, 10, 4).year == 2010);
3950 assert(Date(-7, 4, 5).year == -7);
3955 assert(Date.init.year == 1);
3956 assert(Date(1999, 7, 6).year == 1999);
3957 assert(Date(-1999, 7, 6).year == -1999);
3959 const cdate = Date(1999, 7, 6);
3960 immutable idate = Date(1999, 7, 6);
3970 year = The year to set this Date's year to.
4072 auto date = Date(2010, 1, 1);
4074 assert(date == Date(0, 1, 1));
4077 assert(date == Date(-9, 1, 1));
4082 assertThrown!DateTimeException((Date date){date.yearBC = -1;}(Date(1, 1, 1)));
4084 auto date = Date(0, 7, 6);
4085 const cdate = Date(0, 7, 6);
4086 immutable idate = Date(0, 7, 6);
4105 assert(Date(1999, 7, 6).month == 7);
4106 assert(Date(2010, 10, 4).month == 10);
4107 assert(Date(-7, 4, 5).month == 4);
4112 assert(Date.init.month == 1);
4113 assert(Date(1999, 7, 6).month == 7);
4114 assert(Date(-1999, 7, 6).month == 7);
4116 const cdate = Date(1999, 7, 6);
4117 immutable idate = Date(1999, 7, 6);
4126 month = The month to set this $(LREF Date)'s month to.
4222 static void testDate(Date date, int day) in testDate()
4228 assertThrown!DateTimeException(testDate(Date(1, 1, 1), 0));
4229 assertThrown!DateTimeException(testDate(Date(1, 1, 1), 32));
4230 assertThrown!DateTimeException(testDate(Date(1, 2, 1), 29));
4231 assertThrown!DateTimeException(testDate(Date(4, 2, 1), 30));
4232 assertThrown!DateTimeException(testDate(Date(1, 3, 1), 32));
4233 assertThrown!DateTimeException(testDate(Date(1, 4, 1), 31));
4234 assertThrown!DateTimeException(testDate(Date(1, 5, 1), 32));
4235 assertThrown!DateTimeException(testDate(Date(1, 6, 1), 31));
4236 assertThrown!DateTimeException(testDate(Date(1, 7, 1), 32));
4237 assertThrown!DateTimeException(testDate(Date(1, 8, 1), 32));
4238 assertThrown!DateTimeException(testDate(Date(1, 9, 1), 31));
4239 assertThrown!DateTimeException(testDate(Date(1, 10, 1), 32));
4240 assertThrown!DateTimeException(testDate(Date(1, 11, 1), 31));
4241 assertThrown!DateTimeException(testDate(Date(1, 12, 1), 32));
4243 assertNotThrown!DateTimeException(testDate(Date(1, 1, 1), 31));
4244 assertNotThrown!DateTimeException(testDate(Date(1, 2, 1), 28));
4245 assertNotThrown!DateTimeException(testDate(Date(4, 2, 1), 29));
4246 assertNotThrown!DateTimeException(testDate(Date(1, 3, 1), 31));
4247 assertNotThrown!DateTimeException(testDate(Date(1, 4, 1), 30));
4248 assertNotThrown!DateTimeException(testDate(Date(1, 5, 1), 31));
4249 assertNotThrown!DateTimeException(testDate(Date(1, 6, 1), 30));
4250 assertNotThrown!DateTimeException(testDate(Date(1, 7, 1), 31));
4251 assertNotThrown!DateTimeException(testDate(Date(1, 8, 1), 31));
4252 assertNotThrown!DateTimeException(testDate(Date(1, 9, 1), 30));
4253 assertNotThrown!DateTimeException(testDate(Date(1, 10, 1), 31));
4254 assertNotThrown!DateTimeException(testDate(Date(1, 11, 1), 30));
4255 assertNotThrown!DateTimeException(testDate(Date(1, 12, 1), 31));
4258 auto date = Date(1, 1, 1);
4260 assert(date == Date(1, 1, 6));
4264 assertThrown!DateTimeException(testDate(Date(-1, 1, 1), 0));
4265 assertThrown!DateTimeException(testDate(Date(-1, 1, 1), 32));
4266 assertThrown!DateTimeException(testDate(Date(-1, 2, 1), 29));
4267 assertThrown!DateTimeException(testDate(Date(0, 2, 1), 30));
4268 assertThrown!DateTimeException(testDate(Date(-1, 3, 1), 32));
4269 assertThrown!DateTimeException(testDate(Date(-1, 4, 1), 31));
4270 assertThrown!DateTimeException(testDate(Date(-1, 5, 1), 32));
4271 assertThrown!DateTimeException(testDate(Date(-1, 6, 1), 31));
4272 assertThrown!DateTimeException(testDate(Date(-1, 7, 1), 32));
4273 assertThrown!DateTimeException(testDate(Date(-1, 8, 1), 32));
4274 assertThrown!DateTimeException(testDate(Date(-1, 9, 1), 31));
4275 assertThrown!DateTimeException(testDate(Date(-1, 10, 1), 32));
4276 assertThrown!DateTimeException(testDate(Date(-1, 11, 1), 31));
4277 assertThrown!DateTimeException(testDate(Date(-1, 12, 1), 32));
4279 assertNotThrown!DateTimeException(testDate(Date(-1, 1, 1), 31));
4280 assertNotThrown!DateTimeException(testDate(Date(-1, 2, 1), 28));
4281 assertNotThrown!DateTimeException(testDate(Date(0, 2, 1), 29));
4282 assertNotThrown!DateTimeException(testDate(Date(-1, 3, 1), 31));
4283 assertNotThrown!DateTimeException(testDate(Date(-1, 4, 1), 30));
4284 assertNotThrown!DateTimeException(testDate(Date(-1, 5, 1), 31));
4285 assertNotThrown!DateTimeException(testDate(Date(-1, 6, 1), 30));
4286 assertNotThrown!DateTimeException(testDate(Date(-1, 7, 1), 31));
4287 assertNotThrown!DateTimeException(testDate(Date(-1, 8, 1), 31));
4288 assertNotThrown!DateTimeException(testDate(Date(-1, 9, 1), 30));
4289 assertNotThrown!DateTimeException(testDate(Date(-1, 10, 1), 31));
4290 assertNotThrown!DateTimeException(testDate(Date(-1, 11, 1), 30));
4291 assertNotThrown!DateTimeException(testDate(Date(-1, 12, 1), 31));
4294 auto date = Date(-1, 1, 1);
4296 assert(date == Date(-1, 1, 6));
4299 const cdate = Date(1999, 7, 6);
4300 immutable idate = Date(1999, 7, 6);
4307 Adds the given number of years or months to this $(LREF Date). A
4321 $(LREF Date).
4326 ref Date add(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
4348 auto d1 = Date(2010, 1, 1);
4350 assert(d1 == Date(2010, 12, 1));
4352 auto d2 = Date(2010, 1, 1);
4354 assert(d2 == Date(2009, 2, 1));
4356 auto d3 = Date(2000, 2, 29);
4358 assert(d3 == Date(2001, 3, 1));
4360 auto d4 = Date(2000, 2, 29);
4362 assert(d4 == Date(2001, 2, 28));
4370 auto date = Date(1999, 7, 6);
4372 assert(date == Date(2006, 7, 6));
4374 assert(date == Date(1997, 7, 6));
4378 auto date = Date(1999, 2, 28);
4380 assert(date == Date(2000, 2, 28));
4384 auto date = Date(2000, 2, 29);
4386 assert(date == Date(1999, 3, 1));
4391 auto date = Date(-1999, 7, 6);
4393 assert(date == Date(-2006, 7, 6));
4395 assert(date == Date(-1997, 7, 6));
4399 auto date = Date(-1999, 2, 28);
4401 assert(date == Date(-2000, 2, 28));
4405 auto date = Date(-2000, 2, 29);
4407 assert(date == Date(-1999, 3, 1));
4412 auto date = Date(4, 7, 6);
4414 assert(date == Date(-1, 7, 6));
4416 assert(date == Date(4, 7, 6));
4420 auto date = Date(-4, 7, 6);
4422 assert(date == Date(1, 7, 6));
4424 assert(date == Date(-4, 7, 6));
4428 auto date = Date(4, 7, 6);
4430 assert(date == Date(-4, 7, 6));
4432 assert(date == Date(4, 7, 6));
4436 auto date = Date(-4, 7, 6);
4438 assert(date == Date(4, 7, 6));
4440 assert(date == Date(-4, 7, 6));
4444 auto date = Date(-4, 2, 29);
4446 assert(date == Date(1, 3, 1));
4450 auto date = Date(4, 2, 29);
4452 assert(date == Date(-1, 3, 1));
4456 auto date = Date(4, 2, 29);
4458 assert(date == Date(6, 3, 1));
4461 const cdate = Date(1999, 7, 6);
4462 immutable idate = Date(1999, 7, 6);
4472 auto date = Date(1999, 7, 6);
4474 assert(date == Date(2006, 7, 6));
4476 assert(date == Date(1997, 7, 6));
4480 auto date = Date(1999, 2, 28);
4482 assert(date == Date(2000, 2, 28));
4486 auto date = Date(2000, 2, 29);
4488 assert(date == Date(1999, 2, 28));
4493 auto date = Date(-1999, 7, 6);
4495 assert(date == Date(-2006, 7, 6));
4497 assert(date == Date(-1997, 7, 6));
4501 auto date = Date(-1999, 2, 28);
4503 assert(date == Date(-2000, 2, 28));
4507 auto date = Date(-2000, 2, 29);
4509 assert(date == Date(-1999, 2, 28));
4514 auto date = Date(4, 7, 6);
4516 assert(date == Date(-1, 7, 6));
4518 assert(date == Date(4, 7, 6));
4522 auto date = Date(-4, 7, 6);
4524 assert(date == Date(1, 7, 6));
4526 assert(date == Date(-4, 7, 6));
4530 auto date = Date(4, 7, 6);
4532 assert(date == Date(-4, 7, 6));
4534 assert(date == Date(4, 7, 6));
4538 auto date = Date(-4, 7, 6);
4540 assert(date == Date(4, 7, 6));
4542 assert(date == Date(-4, 7, 6));
4546 auto date = Date(-4, 2, 29);
4548 assert(date == Date(1, 2, 28));
4552 auto date = Date(4, 2, 29);
4554 assert(date == Date(-1, 2, 28));
4558 auto date = Date(4, 2, 29);
4560 assert(date == Date(6, 2, 28));
4567 ref Date add(string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
4613 auto date = Date(1999, 7, 6);
4615 assert(date == Date(1999, 10, 6));
4617 assert(date == Date(1999, 6, 6));
4621 auto date = Date(1999, 7, 6);
4623 assert(date == Date(2000, 1, 6));
4625 assert(date == Date(1999, 7, 6));
4629 auto date = Date(1999, 7, 6);
4631 assert(date == Date(2001, 10, 6));
4633 assert(date == Date(1999, 6, 6));
4637 auto date = Date(1999, 5, 31);
4639 assert(date == Date(1999, 7, 1));
4643 auto date = Date(1999, 5, 31);
4645 assert(date == Date(1999, 5, 1));
4649 auto date = Date(1999, 2, 28);
4651 assert(date == Date(2000, 2, 28));
4655 auto date = Date(2000, 2, 29);
4657 assert(date == Date(2001, 3, 1));
4661 auto date = Date(1999, 7, 31);
4663 assert(date == Date(1999, 8, 31));
4665 assert(date == Date(1999, 10, 1));
4669 auto date = Date(1998, 8, 31);
4671 assert(date == Date(1999, 10, 1));
4673 assert(date == Date(1998, 9, 1));
4677 auto date = Date(1997, 12, 31);
4679 assert(date == Date(1999, 1, 31));
4681 assert(date == Date(1997, 12, 31));
4685 auto date = Date(1997, 12, 31);
4687 assert(date == Date(1999, 3, 3));
4689 assert(date == Date(1998, 1, 3));
4693 auto date = Date(1998, 12, 31);
4695 assert(date == Date(2000, 3, 2));
4697 assert(date == Date(1999, 1, 2));
4701 auto date = Date(1999, 12, 31);
4703 assert(date == Date(2001, 3, 3));
4705 assert(date == Date(2000, 1, 3));
4710 auto date = Date(-1999, 7, 6);
4712 assert(date == Date(-1999, 10, 6));
4714 assert(date == Date(-1999, 6, 6));
4718 auto date = Date(-1999, 7, 6);
4720 assert(date == Date(-1998, 1, 6));
4722 assert(date == Date(-1999, 7, 6));
4726 auto date = Date(-1999, 7, 6);
4728 assert(date == Date(-2001, 4, 6));
4730 assert(date == Date(-1999, 8, 6));
4734 auto date = Date(-1999, 5, 31);
4736 assert(date == Date(-1999, 7, 1));
4740 auto date = Date(-1999, 5, 31);
4742 assert(date == Date(-1999, 5, 1));
4746 auto date = Date(-1999, 2, 28);
4748 assert(date == Date(-2000, 2, 28));
4752 auto date = Date(-2000, 2, 29);
4754 assert(date == Date(-2001, 3, 1));
4758 auto date = Date(-1999, 7, 31);
4760 assert(date == Date(-1999, 8, 31));
4762 assert(date == Date(-1999, 10, 1));
4766 auto date = Date(-1998, 8, 31);
4768 assert(date == Date(-1997, 10, 1));
4770 assert(date == Date(-1998, 9, 1));
4774 auto date = Date(-1997, 12, 31);
4776 assert(date == Date(-1995, 1, 31));
4778 assert(date == Date(-1997, 12, 31));
4782 auto date = Date(-1997, 12, 31);
4784 assert(date == Date(-1995, 3, 3));
4786 assert(date == Date(-1996, 1, 3));
4790 auto date = Date(-2002, 12, 31);
4792 assert(date == Date(-2000, 3, 2));
4794 assert(date == Date(-2001, 1, 2));
4798 auto date = Date(-2001, 12, 31);
4800 assert(date == Date(-1999, 3, 3));
4802 assert(date == Date(-2000, 1, 3));
4807 auto date = Date(1, 1, 1);
4809 assert(date == Date(0, 12, 1));
4811 assert(date == Date(1, 1, 1));
4815 auto date = Date(4, 1, 1);
4817 assert(date == Date(0, 1, 1));
4819 assert(date == Date(4, 1, 1));
4823 auto date = Date(4, 3, 31);
4825 assert(date == Date(0, 3, 2));
4827 assert(date == Date(4, 4, 2));
4831 auto date = Date(4, 3, 31);
4833 assert(date == Date(-3, 3, 3));
4835 assert(date == Date(4, 4, 3));
4839 auto date = Date(-3, 3, 31);
4841 assert(date == Date(-3, 6, 1));
4844 const cdate = Date(1999, 7, 6);
4845 immutable idate = Date(1999, 7, 6);
4855 auto date = Date(1999, 7, 6);
4857 assert(date == Date(1999, 10, 6));
4859 assert(date == Date(1999, 6, 6));
4863 auto date = Date(1999, 7, 6);
4865 assert(date == Date(2000, 1, 6));
4867 assert(date == Date(1999, 7, 6));
4871 auto date = Date(1999, 7, 6);
4873 assert(date == Date(2001, 10, 6));
4875 assert(date == Date(1999, 6, 6));
4879 auto date = Date(1999, 5, 31);
4881 assert(date == Date(1999, 6, 30));
4885 auto date = Date(1999, 5, 31);
4887 assert(date == Date(1999, 4, 30));
4891 auto date = Date(1999, 2, 28);
4893 assert(date == Date(2000, 2, 28));
4897 auto date = Date(2000, 2, 29);
4899 assert(date == Date(2001, 2, 28));
4903 auto date = Date(1999, 7, 31);
4905 assert(date == Date(1999, 8, 31));
4907 assert(date == Date(1999, 9, 30));
4911 auto date = Date(1998, 8, 31);
4913 assert(date == Date(1999, 9, 30));
4915 assert(date == Date(1998, 8, 30));
4919 auto date = Date(1997, 12, 31);
4921 assert(date == Date(1999, 1, 31));
4923 assert(date == Date(1997, 12, 31));
4927 auto date = Date(1997, 12, 31);
4929 assert(date == Date(1999, 2, 28));
4931 assert(date == Date(1997, 12, 28));
4935 auto date = Date(1998, 12, 31);
4937 assert(date == Date(2000, 2, 29));
4939 assert(date == Date(1998, 12, 29));
4943 auto date = Date(1999, 12, 31);
4945 assert(date == Date(2001, 2, 28));
4947 assert(date == Date(1999, 12, 28));
4952 auto date = Date(-1999, 7, 6);
4954 assert(date == Date(-1999, 10, 6));
4956 assert(date == Date(-1999, 6, 6));
4960 auto date = Date(-1999, 7, 6);
4962 assert(date == Date(-1998, 1, 6));
4964 assert(date == Date(-1999, 7, 6));
4968 auto date = Date(-1999, 7, 6);
4970 assert(date == Date(-2001, 4, 6));
4972 assert(date == Date(-1999, 8, 6));
4976 auto date = Date(-1999, 5, 31);
4978 assert(date == Date(-1999, 6, 30));
4982 auto date = Date(-1999, 5, 31);
4984 assert(date == Date(-1999, 4, 30));
4988 auto date = Date(-1999, 2, 28);
4990 assert(date == Date(-2000, 2, 28));
4994 auto date = Date(-2000, 2, 29);
4996 assert(date == Date(-2001, 2, 28));
5000 auto date = Date(-1999, 7, 31);
5002 assert(date == Date(-1999, 8, 31));
5004 assert(date == Date(-1999, 9, 30));
5008 auto date = Date(-1998, 8, 31);
5010 assert(date == Date(-1997, 9, 30));
5012 assert(date == Date(-1998, 8, 30));
5016 auto date = Date(-1997, 12, 31);
5018 assert(date == Date(-1995, 1, 31));
5020 assert(date == Date(-1997, 12, 31));
5024 auto date = Date(-1997, 12, 31);
5026 assert(date == Date(-1995, 2, 28));
5028 assert(date == Date(-1997, 12, 28));
5032 auto date = Date(-2002, 12, 31);
5034 assert(date == Date(-2000, 2, 29));
5036 assert(date == Date(-2002, 12, 29));
5040 auto date = Date(-2001, 12, 31);
5042 assert(date == Date(-1999, 2, 28));
5044 assert(date == Date(-2001, 12, 28));
5049 auto date = Date(1, 1, 1);
5051 assert(date == Date(0, 12, 1));
5053 assert(date == Date(1, 1, 1));
5057 auto date = Date(4, 1, 1);
5059 assert(date == Date(0, 1, 1));
5061 assert(date == Date(4, 1, 1));
5065 auto date = Date(4, 3, 31);
5067 assert(date == Date(0, 2, 29));
5069 assert(date == Date(4, 3, 29));
5073 auto date = Date(4, 3, 31);
5075 assert(date == Date(-3, 2, 28));
5077 assert(date == Date(4, 3, 28));
5081 auto date = Date(-3, 3, 31);
5083 assert(date == Date(-3, 5, 30));
5089 Adds the given number of years or months to this $(LREF Date). A negative
5093 affect larger units. Rolling a $(LREF Date) 12 months gets
5094 the exact same $(LREF Date). However, the days can still be affected due
5103 $(LREF Date).
5108 ref Date roll(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
5117 auto d1 = Date(2010, 1, 1);
5119 assert(d1 == Date(2010, 2, 1));
5121 auto d2 = Date(2010, 1, 1);
5123 assert(d2 == Date(2010, 12, 1));
5125 auto d3 = Date(1999, 1, 29);
5127 assert(d3 == Date(1999, 3, 1));
5129 auto d4 = Date(1999, 1, 29);
5131 assert(d4 == Date(1999, 2, 28));
5133 auto d5 = Date(2000, 2, 29);
5135 assert(d5 == Date(2001, 3, 1));
5137 auto d6 = Date(2000, 2, 29);
5139 assert(d6 == Date(2001, 2, 28));
5144 const cdate = Date(1999, 7, 6);
5145 immutable idate = Date(1999, 7, 6);
5153 ref Date roll(string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
5194 auto date = Date(1999, 7, 6);
5196 assert(date == Date(1999, 10, 6));
5198 assert(date == Date(1999, 6, 6));
5202 auto date = Date(1999, 7, 6);
5204 assert(date == Date(1999, 1, 6));
5206 assert(date == Date(1999, 7, 6));
5210 auto date = Date(1999, 7, 6);
5212 assert(date == Date(1999, 10, 6));
5214 assert(date == Date(1999, 6, 6));
5218 auto date = Date(1999, 5, 31);
5220 assert(date == Date(1999, 7, 1));
5224 auto date = Date(1999, 5, 31);
5226 assert(date == Date(1999, 5, 1));
5230 auto date = Date(1999, 2, 28);
5232 assert(date == Date(1999, 2, 28));
5236 auto date = Date(2000, 2, 29);
5238 assert(date == Date(2000, 2, 29));
5242 auto date = Date(1999, 7, 31);
5244 assert(date == Date(1999, 8, 31));
5246 assert(date == Date(1999, 10, 1));
5250 auto date = Date(1998, 8, 31);
5252 assert(date == Date(1998, 10, 1));
5254 assert(date == Date(1998, 9, 1));
5258 auto date = Date(1997, 12, 31);
5260 assert(date == Date(1997, 1, 31));
5262 assert(date == Date(1997, 12, 31));
5266 auto date = Date(1997, 12, 31);
5268 assert(date == Date(1997, 3, 3));
5270 assert(date == Date(1997, 1, 3));
5274 auto date = Date(1998, 12, 31);
5276 assert(date == Date(1998, 3, 3));
5278 assert(date == Date(1998, 1, 3));
5282 auto date = Date(1999, 12, 31);
5284 assert(date == Date(1999, 3, 3));
5286 assert(date == Date(1999, 1, 3));
5291 auto date = Date(-1999, 7, 6);
5293 assert(date == Date(-1999, 10, 6));
5295 assert(date == Date(-1999, 6, 6));
5299 auto date = Date(-1999, 7, 6);
5301 assert(date == Date(-1999, 1, 6));
5303 assert(date == Date(-1999, 7, 6));
5307 auto date = Date(-1999, 7, 6);
5309 assert(date == Date(-1999, 4, 6));
5311 assert(date == Date(-1999, 8, 6));
5315 auto date = Date(-1999, 5, 31);
5317 assert(date == Date(-1999, 7, 1));
5321 auto date = Date(-1999, 5, 31);
5323 assert(date == Date(-1999, 5, 1));
5327 auto date = Date(-1999, 2, 28);
5329 assert(date == Date(-1999, 2, 28));
5333 auto date = Date(-2000, 2, 29);
5335 assert(date == Date(-2000, 2, 29));
5339 auto date = Date(-1999, 7, 31);
5341 assert(date == Date(-1999, 8, 31));
5343 assert(date == Date(-1999, 10, 1));
5347 auto date = Date(-1998, 8, 31);
5349 assert(date == Date(-1998, 10, 1));
5351 assert(date == Date(-1998, 9, 1));
5355 auto date = Date(-1997, 12, 31);
5357 assert(date == Date(-1997, 1, 31));
5359 assert(date == Date(-1997, 12, 31));
5363 auto date = Date(-1997, 12, 31);
5365 assert(date == Date(-1997, 3, 3));
5367 assert(date == Date(-1997, 1, 3));
5371 auto date = Date(-2002, 12, 31);
5373 assert(date == Date(-2002, 3, 3));
5375 assert(date == Date(-2002, 1, 3));
5379 auto date = Date(-2001, 12, 31);
5381 assert(date == Date(-2001, 3, 3));
5383 assert(date == Date(-2001, 1, 3));
5388 auto date = Date(1, 1, 1);
5390 assert(date == Date(1, 12, 1));
5392 assert(date == Date(1, 1, 1));
5396 auto date = Date(4, 1, 1);
5398 assert(date == Date(4, 1, 1));
5400 assert(date == Date(4, 1, 1));
5404 auto date = Date(4, 3, 31);
5406 assert(date == Date(4, 3, 2));
5408 assert(date == Date(4, 4, 2));
5412 auto date = Date(4, 3, 31);
5414 assert(date == Date(4, 3, 2));
5416 assert(date == Date(4, 4, 2));
5420 auto date = Date(-1, 1, 1);
5422 assert(date == Date(-1, 12, 1));
5424 assert(date == Date(-1, 1, 1));
5428 auto date = Date(-4, 1, 1);
5430 assert(date == Date(-4, 1, 1));
5432 assert(date == Date(-4, 1, 1));
5436 auto date = Date(-4, 3, 31);
5438 assert(date == Date(-4, 3, 2));
5440 assert(date == Date(-4, 4, 2));
5444 auto date = Date(-4, 3, 31);
5446 assert(date == Date(-4, 3, 2));
5448 assert(date == Date(-4, 4, 2));
5452 auto date = Date(-3, 3, 31);
5454 assert(date == Date(-3, 6, 1));
5457 const cdate = Date(1999, 7, 6);
5458 immutable idate = Date(1999, 7, 6);
5468 auto date = Date(1999, 7, 6);
5470 assert(date == Date(1999, 10, 6));
5472 assert(date == Date(1999, 6, 6));
5476 auto date = Date(1999, 7, 6);
5478 assert(date == Date(1999, 1, 6));
5480 assert(date == Date(1999, 7, 6));
5484 auto date = Date(1999, 7, 6);
5486 assert(date == Date(1999, 10, 6));
5488 assert(date == Date(1999, 6, 6));
5492 auto date = Date(1999, 5, 31);
5494 assert(date == Date(1999, 6, 30));
5498 auto date = Date(1999, 5, 31);
5500 assert(date == Date(1999, 4, 30));
5504 auto date = Date(1999, 2, 28);
5506 assert(date == Date(1999, 2, 28));
5510 auto date = Date(2000, 2, 29);
5512 assert(date == Date(2000, 2, 29));
5516 auto date = Date(1999, 7, 31);
5518 assert(date == Date(1999, 8, 31));
5520 assert(date == Date(1999, 9, 30));
5524 auto date = Date(1998, 8, 31);
5526 assert(date == Date(1998, 9, 30));
5528 assert(date == Date(1998, 8, 30));
5532 auto date = Date(1997, 12, 31);
5534 assert(date == Date(1997, 1, 31));
5536 assert(date == Date(1997, 12, 31));
5540 auto date = Date(1997, 12, 31);
5542 assert(date == Date(1997, 2, 28));
5544 assert(date == Date(1997, 12, 28));
5548 auto date = Date(1998, 12, 31);
5550 assert(date == Date(1998, 2, 28));
5552 assert(date == Date(1998, 12, 28));
5556 auto date = Date(1999, 12, 31);
5558 assert(date == Date(1999, 2, 28));
5560 assert(date == Date(1999, 12, 28));
5565 auto date = Date(-1999, 7, 6);
5567 assert(date == Date(-1999, 10, 6));
5569 assert(date == Date(-1999, 6, 6));
5573 auto date = Date(-1999, 7, 6);
5575 assert(date == Date(-1999, 1, 6));
5577 assert(date == Date(-1999, 7, 6));
5581 auto date = Date(-1999, 7, 6);
5583 assert(date == Date(-1999, 4, 6));
5585 assert(date == Date(-1999, 8, 6));
5589 auto date = Date(-1999, 5, 31);
5591 assert(date == Date(-1999, 6, 30));
5595 auto date = Date(-1999, 5, 31);
5597 assert(date == Date(-1999, 4, 30));
5601 auto date = Date(-1999, 2, 28);
5603 assert(date == Date(-1999, 2, 28));
5607 auto date = Date(-2000, 2, 29);
5609 assert(date == Date(-2000, 2, 29));
5613 auto date = Date(-1999, 7, 31);
5615 assert(date == Date(-1999, 8, 31));
5617 assert(date == Date(-1999, 9, 30));
5621 auto date = Date(-1998, 8, 31);
5623 assert(date == Date(-1998, 9, 30));
5625 assert(date == Date(-1998, 8, 30));
5629 auto date = Date(-1997, 12, 31);
5631 assert(date == Date(-1997, 1, 31));
5633 assert(date == Date(-1997, 12, 31));
5637 auto date = Date(-1997, 12, 31);
5639 assert(date == Date(-1997, 2, 28));
5641 assert(date == Date(-1997, 12, 28));
5645 auto date = Date(-2002, 12, 31);
5647 assert(date == Date(-2002, 2, 28));
5649 assert(date == Date(-2002, 12, 28));
5653 auto date = Date(-2001, 12, 31);
5655 assert(date == Date(-2001, 2, 28));
5657 assert(date == Date(-2001, 12, 28));
5662 auto date = Date(1, 1, 1);
5664 assert(date == Date(1, 12, 1));
5666 assert(date == Date(1, 1, 1));
5670 auto date = Date(4, 1, 1);
5672 assert(date == Date(4, 1, 1));
5674 assert(date == Date(4, 1, 1));
5678 auto date = Date(4, 3, 31);
5680 assert(date == Date(4, 2, 29));
5682 assert(date == Date(4, 3, 29));
5686 auto date = Date(4, 3, 31);
5688 assert(date == Date(4, 2, 29));
5690 assert(date == Date(4, 3, 29));
5694 auto date = Date(-1, 1, 1);
5696 assert(date == Date(-1, 12, 1));
5698 assert(date == Date(-1, 1, 1));
5702 auto date = Date(-4, 1, 1);
5704 assert(date == Date(-4, 1, 1));
5706 assert(date == Date(-4, 1, 1));
5710 auto date = Date(-4, 3, 31);
5712 assert(date == Date(-4, 2, 29));
5714 assert(date == Date(-4, 3, 29));
5718 auto date = Date(-4, 3, 31);
5720 assert(date == Date(-4, 2, 29));
5722 assert(date == Date(-4, 3, 29));
5726 auto date = Date(-3, 3, 31);
5728 assert(date == Date(-3, 5, 30));
5734 Adds the given number of units to this $(LREF Date). A negative number
5738 affect larger units. For instance, rolling a $(LREF Date) one
6194 either $(LREF Date) is is irrelevant. It is the difference in the month
6200 rhs = The $(LREF Date) to subtract from this one.
6202 int diffMonths(in Date rhs) const @safe pure nothrow @nogc in diffMonths()
6213 assert(Date(1999, 2, 1).diffMonths(Date(1999, 1, 31)) == 1);
6214 assert(Date(1999, 1, 31).diffMonths(Date(1999, 2, 1)) == -1);
6215 assert(Date(1999, 3, 1).diffMonths(Date(1999, 1, 1)) == 2);
6216 assert(Date(1999, 1, 1).diffMonths(Date(1999, 3, 31)) == -2);
6221 auto date = Date(1999, 7, 6);
6224 assert(date.diffMonths(Date(1998, 6, 5)) == 13);
6225 assert(date.diffMonths(Date(1998, 7, 5)) == 12);
6226 assert(date.diffMonths(Date(1998, 8, 5)) == 11);
6227 assert(date.diffMonths(Date(1998, 9, 5)) == 10);
6228 assert(date.diffMonths(Date(1998, 10, 5)) == 9);
6229 assert(date.diffMonths(Date(1998, 11, 5)) == 8);
6230 assert(date.diffMonths(Date(1998, 12, 5)) == 7);
6231 assert(date.diffMonths(Date(1999, 1, 5)) == 6);
6232 assert(date.diffMonths(Date(1999, 2, 6)) == 5);
6233 assert(date.diffMonths(Date(1999, 3, 6)) == 4);
6234 assert(date.diffMonths(Date(1999, 4, 6)) == 3);
6235 assert(date.diffMonths(Date(1999, 5, 6)) == 2);
6236 assert(date.diffMonths(Date(1999, 6, 6)) == 1);
6238 assert(date.diffMonths(Date(1999, 8, 6)) == -1);
6239 assert(date.diffMonths(Date(1999, 9, 6)) == -2);
6240 assert(date.diffMonths(Date(1999, 10, 6)) == -3);
6241 assert(date.diffMonths(Date(1999, 11, 6)) == -4);
6242 assert(date.diffMonths(Date(1999, 12, 6)) == -5);
6243 assert(date.diffMonths(Date(2000, 1, 6)) == -6);
6244 assert(date.diffMonths(Date(2000, 2, 6)) == -7);
6245 assert(date.diffMonths(Date(2000, 3, 6)) == -8);
6246 assert(date.diffMonths(Date(2000, 4, 6)) == -9);
6247 assert(date.diffMonths(Date(2000, 5, 6)) == -10);
6248 assert(date.diffMonths(Date(2000, 6, 6)) == -11);
6249 assert(date.diffMonths(Date(2000, 7, 6)) == -12);
6250 assert(date.diffMonths(Date(2000, 8, 6)) == -13);
6252 assert(Date(1998, 6, 5).diffMonths(date) == -13);
6253 assert(Date(1998, 7, 5).diffMonths(date) == -12);
6254 assert(Date(1998, 8, 5).diffMonths(date) == -11);
6255 assert(Date(1998, 9, 5).diffMonths(date) == -10);
6256 assert(Date(1998, 10, 5).diffMonths(date) == -9);
6257 assert(Date(1998, 11, 5).diffMonths(date) == -8);
6258 assert(Date(1998, 12, 5).diffMonths(date) == -7);
6259 assert(Date(1999, 1, 5).diffMonths(date) == -6);
6260 assert(Date(1999, 2, 6).diffMonths(date) == -5);
6261 assert(Date(1999, 3, 6).diffMonths(date) == -4);
6262 assert(Date(1999, 4, 6).diffMonths(date) == -3);
6263 assert(Date(1999, 5, 6).diffMonths(date) == -2);
6264 assert(Date(1999, 6, 6).diffMonths(date) == -1);
6265 assert(Date(1999, 8, 6).diffMonths(date) == 1);
6266 assert(Date(1999, 9, 6).diffMonths(date) == 2);
6267 assert(Date(1999, 10, 6).diffMonths(date) == 3);
6268 assert(Date(1999, 11, 6).diffMonths(date) == 4);
6269 assert(Date(1999, 12, 6).diffMonths(date) == 5);
6270 assert(Date(2000, 1, 6).diffMonths(date) == 6);
6271 assert(Date(2000, 2, 6).diffMonths(date) == 7);
6272 assert(Date(2000, 3, 6).diffMonths(date) == 8);
6273 assert(Date(2000, 4, 6).diffMonths(date) == 9);
6274 assert(Date(2000, 5, 6).diffMonths(date) == 10);
6275 assert(Date(2000, 6, 6).diffMonths(date) == 11);
6276 assert(Date(2000, 7, 6).diffMonths(date) == 12);
6277 assert(Date(2000, 8, 6).diffMonths(date) == 13);
6279 assert(date.diffMonths(Date(1999, 6, 30)) == 1);
6280 assert(date.diffMonths(Date(1999, 7, 1)) == 0);
6281 assert(date.diffMonths(Date(1999, 7, 6)) == 0);
6282 assert(date.diffMonths(Date(1999, 7, 11)) == 0);
6283 assert(date.diffMonths(Date(1999, 7, 16)) == 0);
6284 assert(date.diffMonths(Date(1999, 7, 21)) == 0);
6285 assert(date.diffMonths(Date(1999, 7, 26)) == 0);
6286 assert(date.diffMonths(Date(1999, 7, 31)) == 0);
6287 assert(date.diffMonths(Date(1999, 8, 1)) == -1);
6289 assert(date.diffMonths(Date(1990, 6, 30)) == 109);
6290 assert(date.diffMonths(Date(1990, 7, 1)) == 108);
6291 assert(date.diffMonths(Date(1990, 7, 6)) == 108);
6292 assert(date.diffMonths(Date(1990, 7, 11)) == 108);
6293 assert(date.diffMonths(Date(1990, 7, 16)) == 108);
6294 assert(date.diffMonths(Date(1990, 7, 21)) == 108);
6295 assert(date.diffMonths(Date(1990, 7, 26)) == 108);
6296 assert(date.diffMonths(Date(1990, 7, 31)) == 108);
6297 assert(date.diffMonths(Date(1990, 8, 1)) == 107);
6299 assert(Date(1999, 6, 30).diffMonths(date) == -1);
6300 assert(Date(1999, 7, 1).diffMonths(date) == 0);
6301 assert(Date(1999, 7, 6).diffMonths(date) == 0);
6302 assert(Date(1999, 7, 11).diffMonths(date) == 0);
6303 assert(Date(1999, 7, 16).diffMonths(date) == 0);
6304 assert(Date(1999, 7, 21).diffMonths(date) == 0);
6305 assert(Date(1999, 7, 26).diffMonths(date) == 0);
6306 assert(Date(1999, 7, 31).diffMonths(date) == 0);
6307 assert(Date(1999, 8, 1).diffMonths(date) == 1);
6309 assert(Date(1990, 6, 30).diffMonths(date) == -109);
6310 assert(Date(1990, 7, 1).diffMonths(date) == -108);
6311 assert(Date(1990, 7, 6).diffMonths(date) == -108);
6312 assert(Date(1990, 7, 11).diffMonths(date) == -108);
6313 assert(Date(1990, 7, 16).diffMonths(date) == -108);
6314 assert(Date(1990, 7, 21).diffMonths(date) == -108);
6315 assert(Date(1990, 7, 26).diffMonths(date) == -108);
6316 assert(Date(1990, 7, 31).diffMonths(date) == -108);
6317 assert(Date(1990, 8, 1).diffMonths(date) == -107);
6320 auto dateBC = Date(-1999, 7, 6);
6322 assert(dateBC.diffMonths(Date(-2000, 6, 5)) == 13);
6323 assert(dateBC.diffMonths(Date(-2000, 7, 5)) == 12);
6324 assert(dateBC.diffMonths(Date(-2000, 8, 5)) == 11);
6325 assert(dateBC.diffMonths(Date(-2000, 9, 5)) == 10);
6326 assert(dateBC.diffMonths(Date(-2000, 10, 5)) == 9);
6327 assert(dateBC.diffMonths(Date(-2000, 11, 5)) == 8);
6328 assert(dateBC.diffMonths(Date(-2000, 12, 5)) == 7);
6329 assert(dateBC.diffMonths(Date(-1999, 1, 5)) == 6);
6330 assert(dateBC.diffMonths(Date(-1999, 2, 6)) == 5);
6331 assert(dateBC.diffMonths(Date(-1999, 3, 6)) == 4);
6332 assert(dateBC.diffMonths(Date(-1999, 4, 6)) == 3);
6333 assert(dateBC.diffMonths(Date(-1999, 5, 6)) == 2);
6334 assert(dateBC.diffMonths(Date(-1999, 6, 6)) == 1);
6336 assert(dateBC.diffMonths(Date(-1999, 8, 6)) == -1);
6337 assert(dateBC.diffMonths(Date(-1999, 9, 6)) == -2);
6338 assert(dateBC.diffMonths(Date(-1999, 10, 6)) == -3);
6339 assert(dateBC.diffMonths(Date(-1999, 11, 6)) == -4);
6340 assert(dateBC.diffMonths(Date(-1999, 12, 6)) == -5);
6341 assert(dateBC.diffMonths(Date(-1998, 1, 6)) == -6);
6342 assert(dateBC.diffMonths(Date(-1998, 2, 6)) == -7);
6343 assert(dateBC.diffMonths(Date(-1998, 3, 6)) == -8);
6344 assert(dateBC.diffMonths(Date(-1998, 4, 6)) == -9);
6345 assert(dateBC.diffMonths(Date(-1998, 5, 6)) == -10);
6346 assert(dateBC.diffMonths(Date(-1998, 6, 6)) == -11);
6347 assert(dateBC.diffMonths(Date(-1998, 7, 6)) == -12);
6348 assert(dateBC.diffMonths(Date(-1998, 8, 6)) == -13);
6350 assert(Date(-2000, 6, 5).diffMonths(dateBC) == -13);
6351 assert(Date(-2000, 7, 5).diffMonths(dateBC) == -12);
6352 assert(Date(-2000, 8, 5).diffMonths(dateBC) == -11);
6353 assert(Date(-2000, 9, 5).diffMonths(dateBC) == -10);
6354 assert(Date(-2000, 10, 5).diffMonths(dateBC) == -9);
6355 assert(Date(-2000, 11, 5).diffMonths(dateBC) == -8);
6356 assert(Date(-2000, 12, 5).diffMonths(dateBC) == -7);
6357 assert(Date(-1999, 1, 5).diffMonths(dateBC) == -6);
6358 assert(Date(-1999, 2, 6).diffMonths(dateBC) == -5);
6359 assert(Date(-1999, 3, 6).diffMonths(dateBC) == -4);
6360 assert(Date(-1999, 4, 6).diffMonths(dateBC) == -3);
6361 assert(Date(-1999, 5, 6).diffMonths(dateBC) == -2);
6362 assert(Date(-1999, 6, 6).diffMonths(dateBC) == -1);
6363 assert(Date(-1999, 8, 6).diffMonths(dateBC) == 1);
6364 assert(Date(-1999, 9, 6).diffMonths(dateBC) == 2);
6365 assert(Date(-1999, 10, 6).diffMonths(dateBC) == 3);
6366 assert(Date(-1999, 11, 6).diffMonths(dateBC) == 4);
6367 assert(Date(-1999, 12, 6).diffMonths(dateBC) == 5);
6368 assert(Date(-1998, 1, 6).diffMonths(dateBC) == 6);
6369 assert(Date(-1998, 2, 6).diffMonths(dateBC) == 7);
6370 assert(Date(-1998, 3, 6).diffMonths(dateBC) == 8);
6371 assert(Date(-1998, 4, 6).diffMonths(dateBC) == 9);
6372 assert(Date(-1998, 5, 6).diffMonths(dateBC) == 10);
6373 assert(Date(-1998, 6, 6).diffMonths(dateBC) == 11);
6374 assert(Date(-1998, 7, 6).diffMonths(dateBC) == 12);
6375 assert(Date(-1998, 8, 6).diffMonths(dateBC) == 13);
6377 assert(dateBC.diffMonths(Date(-1999, 6, 30)) == 1);
6378 assert(dateBC.diffMonths(Date(-1999, 7, 1)) == 0);
6379 assert(dateBC.diffMonths(Date(-1999, 7, 6)) == 0);
6380 assert(dateBC.diffMonths(Date(-1999, 7, 11)) == 0);
6381 assert(dateBC.diffMonths(Date(-1999, 7, 16)) == 0);
6382 assert(dateBC.diffMonths(Date(-1999, 7, 21)) == 0);
6383 assert(dateBC.diffMonths(Date(-1999, 7, 26)) == 0);
6384 assert(dateBC.diffMonths(Date(-1999, 7, 31)) == 0);
6385 assert(dateBC.diffMonths(Date(-1999, 8, 1)) == -1);
6387 assert(dateBC.diffMonths(Date(-2008, 6, 30)) == 109);
6388 assert(dateBC.diffMonths(Date(-2008, 7, 1)) == 108);
6389 assert(dateBC.diffMonths(Date(-2008, 7, 6)) == 108);
6390 assert(dateBC.diffMonths(Date(-2008, 7, 11)) == 108);
6391 assert(dateBC.diffMonths(Date(-2008, 7, 16)) == 108);
6392 assert(dateBC.diffMonths(Date(-2008, 7, 21)) == 108);
6393 assert(dateBC.diffMonths(Date(-2008, 7, 26)) == 108);
6394 assert(dateBC.diffMonths(Date(-2008, 7, 31)) == 108);
6395 assert(dateBC.diffMonths(Date(-2008, 8, 1)) == 107);
6397 assert(Date(-1999, 6, 30).diffMonths(dateBC) == -1);
6398 assert(Date(-1999, 7, 1).diffMonths(dateBC) == 0);
6399 assert(Date(-1999, 7, 6).diffMonths(dateBC) == 0);
6400 assert(Date(-1999, 7, 11).diffMonths(dateBC) == 0);
6401 assert(Date(-1999, 7, 16).diffMonths(dateBC) == 0);
6402 assert(Date(-1999, 7, 21).diffMonths(dateBC) == 0);
6403 assert(Date(-1999, 7, 26).diffMonths(dateBC) == 0);
6404 assert(Date(-1999, 7, 31).diffMonths(dateBC) == 0);
6405 assert(Date(-1999, 8, 1).diffMonths(dateBC) == 1);
6407 assert(Date(-2008, 6, 30).diffMonths(dateBC) == -109);
6408 assert(Date(-2008, 7, 1).diffMonths(dateBC) == -108);
6409 assert(Date(-2008, 7, 6).diffMonths(dateBC) == -108);
6410 assert(Date(-2008, 7, 11).diffMonths(dateBC) == -108);
6411 assert(Date(-2008, 7, 16).diffMonths(dateBC) == -108);
6412 assert(Date(-2008, 7, 21).diffMonths(dateBC) == -108);
6413 assert(Date(-2008, 7, 26).diffMonths(dateBC) == -108);
6414 assert(Date(-2008, 7, 31).diffMonths(dateBC) == -108);
6415 assert(Date(-2008, 8, 1).diffMonths(dateBC) == -107);
6418 assert(Date(3, 3, 3).diffMonths(Date(-5, 5, 5)) == 94);
6419 assert(Date(-5, 5, 5).diffMonths(Date(3, 3, 3)) == -94);
6421 const cdate = Date(1999, 7, 6);
6422 immutable idate = Date(1999, 7, 6);
6438 Whether this $(LREF Date) is in a leap year.
6447 auto date = Date(1999, 7, 6);
6448 const cdate = Date(1999, 7, 6);
6449 immutable idate = Date(1999, 7, 6);
6457 Day of the week this $(LREF Date) is on.
6466 const cdate = Date(1999, 7, 6);
6467 immutable idate = Date(1999, 7, 6);
6476 Day of the year this $(LREF Date) is on.
6493 assert(Date(1999, 1, 1).dayOfYear == 1);
6494 assert(Date(1999, 12, 31).dayOfYear == 365);
6495 assert(Date(2000, 12, 31).dayOfYear == 366);
6506 assert(Date(year, doy.md.month, doy.md.day).dayOfYear == doy.day);
6512 assert(Date(year, doy.md.month, doy.md.day).dayOfYear == doy.day);
6515 const cdate = Date(1999, 7, 6);
6516 immutable idate = Date(1999, 7, 6);
6526 $(LREF Date) is on.
6567 static void test(Date date, int day, MonthDay expected, size_t line = __LINE__)
6576 test(Date(1999, 1, 1), doy.day, doy.md);
6577 test(Date(-1, 1, 1), doy.day, doy.md);
6582 test(Date(2000, 1, 1), doy.day, doy.md);
6583 test(Date(-4, 1, 1), doy.day, doy.md);
6586 const cdate = Date(1999, 7, 6);
6587 immutable idate = Date(1999, 7, 6);
6594 The Xth day of the Gregorian Calendar that this $(LREF Date) is on.
6652 assert(Date(1, 1, 1).dayOfGregorianCal == 1);
6653 assert(Date(1, 12, 31).dayOfGregorianCal == 365);
6654 assert(Date(2, 1, 1).dayOfGregorianCal == 366);
6656 assert(Date(0, 12, 31).dayOfGregorianCal == 0);
6657 assert(Date(0, 1, 1).dayOfGregorianCal == -365);
6658 assert(Date(-1, 12, 31).dayOfGregorianCal == -366);
6660 assert(Date(2000, 1, 1).dayOfGregorianCal == 730_120);
6661 assert(Date(2010, 12, 31).dayOfGregorianCal == 734_137);
6671 auto date = Date(1999, 7, 6);
6672 const cdate = Date(1999, 7, 6);
6673 immutable idate = Date(1999, 7, 6);
6680 The Xth day of the Gregorian Calendar that this $(LREF Date) is on.
6683 day = The day of the Gregorian Calendar to set this $(LREF Date) to.
6687 this = Date(day); in dayOfGregorianCal()
6693 auto date = Date.init;
6695 assert(date == Date(1, 1, 1));
6698 assert(date == Date(1, 12, 31));
6701 assert(date == Date(2, 1, 1));
6704 assert(date == Date(0, 12, 31));
6707 assert(date == Date(-0, 1, 1));
6710 assert(date == Date(-1, 12, 31));
6713 assert(date == Date(2000, 1, 1));
6716 assert(date == Date(2010, 12, 31));
6721 auto date = Date(1999, 7, 6);
6722 const cdate = Date(1999, 7, 6);
6723 immutable idate = Date(1999, 7, 6);
6732 The ISO 8601 week of the year that this $(LREF Date) is in.
6735 $(HTTP en.wikipedia.org/wiki/ISO_week_date, ISO Week Date)
6747 switch (Date(_year + 1, 1, 1).dayOfWeek) in isoWeek()
6765 return Date(_year - 1, 12, 31).isoWeek; in isoWeek()
6774 assert(Date(2009, 12, 28).isoWeek == 53);
6775 assert(Date(2009, 12, 29).isoWeek == 53);
6776 assert(Date(2009, 12, 30).isoWeek == 53);
6777 assert(Date(2009, 12, 31).isoWeek == 53);
6778 assert(Date(2010, 1, 1).isoWeek == 53);
6779 assert(Date(2010, 1, 2).isoWeek == 53);
6780 assert(Date(2010, 1, 3).isoWeek == 53);
6781 assert(Date(2010, 1, 4).isoWeek == 1);
6782 assert(Date(2010, 1, 5).isoWeek == 1);
6783 assert(Date(2010, 1, 6).isoWeek == 1);
6784 assert(Date(2010, 1, 7).isoWeek == 1);
6785 assert(Date(2010, 1, 8).isoWeek == 1);
6786 assert(Date(2010, 1, 9).isoWeek == 1);
6787 assert(Date(2010, 1, 10).isoWeek == 1);
6788 assert(Date(2010, 1, 11).isoWeek == 2);
6789 assert(Date(2010, 12, 31).isoWeek == 52);
6791 assert(Date(2004, 12, 26).isoWeek == 52);
6792 assert(Date(2004, 12, 27).isoWeek == 53);
6793 assert(Date(2004, 12, 28).isoWeek == 53);
6794 assert(Date(2004, 12, 29).isoWeek == 53);
6795 assert(Date(2004, 12, 30).isoWeek == 53);
6796 assert(Date(2004, 12, 31).isoWeek == 53);
6797 assert(Date(2005, 1, 1).isoWeek == 53);
6798 assert(Date(2005, 1, 2).isoWeek == 53);
6800 assert(Date(2005, 12, 31).isoWeek == 52);
6801 assert(Date(2007, 1, 1).isoWeek == 1);
6803 assert(Date(2007, 12, 30).isoWeek == 52);
6804 assert(Date(2007, 12, 31).isoWeek == 1);
6805 assert(Date(2008, 1, 1).isoWeek == 1);
6807 assert(Date(2008, 12, 28).isoWeek == 52);
6808 assert(Date(2008, 12, 29).isoWeek == 1);
6809 assert(Date(2008, 12, 30).isoWeek == 1);
6810 assert(Date(2008, 12, 31).isoWeek == 1);
6811 assert(Date(2009, 1, 1).isoWeek == 1);
6812 assert(Date(2009, 1, 2).isoWeek == 1);
6813 assert(Date(2009, 1, 3).isoWeek == 1);
6814 assert(Date(2009, 1, 4).isoWeek == 1);
6820 assert(Date(0, 12, 31).isoWeek == 52);
6821 assert(Date(0, 1, 4).isoWeek == 1);
6822 assert(Date(0, 1, 1).isoWeek == 52);
6824 const cdate = Date(1999, 7, 6);
6825 immutable idate = Date(1999, 7, 6);
6834 $(LREF Date) for the last day in the month that this $(LREF Date) is in.
6836 @property Date endOfMonth() const @safe pure nothrow in endOfMonth()
6839 return Date(_year, _month, maxDay(_year, _month)); in endOfMonth()
6847 assert(Date(1999, 1, 6).endOfMonth == Date(1999, 1, 31));
6848 assert(Date(1999, 2, 7).endOfMonth == Date(1999, 2, 28));
6849 assert(Date(2000, 2, 7).endOfMonth == Date(2000, 2, 29));
6850 assert(Date(2000, 6, 4).endOfMonth == Date(2000, 6, 30));
6856 assert(Date(1999, 1, 1).endOfMonth == Date(1999, 1, 31));
6857 assert(Date(1999, 2, 1).endOfMonth == Date(1999, 2, 28));
6858 assert(Date(2000, 2, 1).endOfMonth == Date(2000, 2, 29));
6859 assert(Date(1999, 3, 1).endOfMonth == Date(1999, 3, 31));
6860 assert(Date(1999, 4, 1).endOfMonth == Date(1999, 4, 30));
6861 assert(Date(1999, 5, 1).endOfMonth == Date(1999, 5, 31));
6862 assert(Date(1999, 6, 1).endOfMonth == Date(1999, 6, 30));
6863 assert(Date(1999, 7, 1).endOfMonth == Date(1999, 7, 31));
6864 assert(Date(1999, 8, 1).endOfMonth == Date(1999, 8, 31));
6865 assert(Date(1999, 9, 1).endOfMonth == Date(1999, 9, 30));
6866 assert(Date(1999, 10, 1).endOfMonth == Date(1999, 10, 31));
6867 assert(Date(1999, 11, 1).endOfMonth == Date(1999, 11, 30));
6868 assert(Date(1999, 12, 1).endOfMonth == Date(1999, 12, 31));
6871 assert(Date(-1999, 1, 1).endOfMonth == Date(-1999, 1, 31));
6872 assert(Date(-1999, 2, 1).endOfMonth == Date(-1999, 2, 28));
6873 assert(Date(-2000, 2, 1).endOfMonth == Date(-2000, 2, 29));
6874 assert(Date(-1999, 3, 1).endOfMonth == Date(-1999, 3, 31));
6875 assert(Date(-1999, 4, 1).endOfMonth == Date(-1999, 4, 30));
6876 assert(Date(-1999, 5, 1).endOfMonth == Date(-1999, 5, 31));
6877 assert(Date(-1999, 6, 1).endOfMonth == Date(-1999, 6, 30));
6878 assert(Date(-1999, 7, 1).endOfMonth == Date(-1999, 7, 31));
6879 assert(Date(-1999, 8, 1).endOfMonth == Date(-1999, 8, 31));
6880 assert(Date(-1999, 9, 1).endOfMonth == Date(-1999, 9, 30));
6881 assert(Date(-1999, 10, 1).endOfMonth == Date(-1999, 10, 31));
6882 assert(Date(-1999, 11, 1).endOfMonth == Date(-1999, 11, 30));
6883 assert(Date(-1999, 12, 1).endOfMonth == Date(-1999, 12, 31));
6885 const cdate = Date(1999, 7, 6);
6886 immutable idate = Date(1999, 7, 6);
6887 static assert(!__traits(compiles, cdate.endOfMonth = Date(1999, 7, 30)));
6888 static assert(!__traits(compiles, idate.endOfMonth = Date(1999, 7, 30)));
6893 The last day in the month that this $(LREF Date) is in.
6903 assert(Date(1999, 1, 6).daysInMonth == 31);
6904 assert(Date(1999, 2, 7).daysInMonth == 28);
6905 assert(Date(2000, 2, 7).daysInMonth == 29);
6906 assert(Date(2000, 6, 4).daysInMonth == 30);
6912 assert(Date(1999, 1, 1).daysInMonth == 31);
6913 assert(Date(1999, 2, 1).daysInMonth == 28);
6914 assert(Date(2000, 2, 1).daysInMonth == 29);
6915 assert(Date(1999, 3, 1).daysInMonth == 31);
6916 assert(Date(1999, 4, 1).daysInMonth == 30);
6917 assert(Date(1999, 5, 1).daysInMonth == 31);
6918 assert(Date(1999, 6, 1).daysInMonth == 30);
6919 assert(Date(1999, 7, 1).daysInMonth == 31);
6920 assert(Date(1999, 8, 1).daysInMonth == 31);
6921 assert(Date(1999, 9, 1).daysInMonth == 30);
6922 assert(Date(1999, 10, 1).daysInMonth == 31);
6923 assert(Date(1999, 11, 1).daysInMonth == 30);
6924 assert(Date(1999, 12, 1).daysInMonth == 31);
6927 assert(Date(-1999, 1, 1).daysInMonth == 31);
6928 assert(Date(-1999, 2, 1).daysInMonth == 28);
6929 assert(Date(-2000, 2, 1).daysInMonth == 29);
6930 assert(Date(-1999, 3, 1).daysInMonth == 31);
6931 assert(Date(-1999, 4, 1).daysInMonth == 30);
6932 assert(Date(-1999, 5, 1).daysInMonth == 31);
6933 assert(Date(-1999, 6, 1).daysInMonth == 30);
6934 assert(Date(-1999, 7, 1).daysInMonth == 31);
6935 assert(Date(-1999, 8, 1).daysInMonth == 31);
6936 assert(Date(-1999, 9, 1).daysInMonth == 30);
6937 assert(Date(-1999, 10, 1).daysInMonth == 31);
6938 assert(Date(-1999, 11, 1).daysInMonth == 30);
6939 assert(Date(-1999, 12, 1).daysInMonth == 31);
6941 const cdate = Date(1999, 7, 6);
6942 immutable idate = Date(1999, 7, 6);
6959 assert(Date(1, 1, 1).isAD);
6960 assert(Date(2010, 12, 31).isAD);
6961 assert(!Date(0, 12, 31).isAD);
6962 assert(!Date(-2010, 1, 1).isAD);
6967 assert(Date(2010, 7, 4).isAD);
6968 assert(Date(1, 1, 1).isAD);
6969 assert(!Date(0, 1, 1).isAD);
6970 assert(!Date(-1, 1, 1).isAD);
6971 assert(!Date(-2010, 7, 4).isAD);
6973 const cdate = Date(1999, 7, 6);
6974 immutable idate = Date(1999, 7, 6);
6982 $(LREF Date) at noon (since the Julian day changes at noon).
6991 assert(Date(-4713, 11, 24).julianDay == 0);
6992 assert(Date(0, 12, 31).julianDay == 1_721_425);
6993 assert(Date(1, 1, 1).julianDay == 1_721_426);
6994 assert(Date(1582, 10, 15).julianDay == 2_299_161);
6995 assert(Date(1858, 11, 17).julianDay == 2_400_001);
6996 assert(Date(1982, 1, 4).julianDay == 2_444_974);
6997 assert(Date(1996, 3, 31).julianDay == 2_450_174);
6998 assert(Date(2010, 8, 24).julianDay == 2_455_433);
7000 const cdate = Date(1999, 7, 6);
7001 immutable idate = Date(1999, 7, 6);
7019 assert(Date(1858, 11, 17).modJulianDay == 0);
7020 assert(Date(2010, 8, 24).modJulianDay == 55_432);
7022 const cdate = Date(1999, 7, 6);
7023 immutable idate = Date(1999, 7, 6);
7030 Converts this $(LREF Date) to a string with the format YYYYMMDD.
7056 assert(Date(2010, 7, 4).toISOString() == "20100704");
7057 assert(Date(1998, 12, 25).toISOString() == "19981225");
7058 assert(Date(0, 1, 5).toISOString() == "00000105");
7059 assert(Date(-4, 1, 5).toISOString() == "-00040105");
7065 assert(Date(9, 12, 4).toISOString() == "00091204");
7066 assert(Date(99, 12, 4).toISOString() == "00991204");
7067 assert(Date(999, 12, 4).toISOString() == "09991204");
7068 assert(Date(9999, 7, 4).toISOString() == "99990704");
7069 assert(Date(10000, 10, 20).toISOString() == "+100001020");
7072 assert(Date(0, 12, 4).toISOString() == "00001204");
7073 assert(Date(-9, 12, 4).toISOString() == "-00091204");
7074 assert(Date(-99, 12, 4).toISOString() == "-00991204");
7075 assert(Date(-999, 12, 4).toISOString() == "-09991204");
7076 assert(Date(-9999, 7, 4).toISOString() == "-99990704");
7077 assert(Date(-10000, 10, 20).toISOString() == "-100001020");
7079 const cdate = Date(1999, 7, 6);
7080 immutable idate = Date(1999, 7, 6);
7086 Converts this $(LREF Date) to a string with the format YYYY-MM-DD.
7112 assert(Date(2010, 7, 4).toISOExtString() == "2010-07-04");
7113 assert(Date(1998, 12, 25).toISOExtString() == "1998-12-25");
7114 assert(Date(0, 1, 5).toISOExtString() == "0000-01-05");
7115 assert(Date(-4, 1, 5).toISOExtString() == "-0004-01-05");
7121 assert(Date(9, 12, 4).toISOExtString() == "0009-12-04");
7122 assert(Date(99, 12, 4).toISOExtString() == "0099-12-04");
7123 assert(Date(999, 12, 4).toISOExtString() == "0999-12-04");
7124 assert(Date(9999, 7, 4).toISOExtString() == "9999-07-04");
7125 assert(Date(10000, 10, 20).toISOExtString() == "+10000-10-20");
7128 assert(Date(0, 12, 4).toISOExtString() == "0000-12-04");
7129 assert(Date(-9, 12, 4).toISOExtString() == "-0009-12-04");
7130 assert(Date(-99, 12, 4).toISOExtString() == "-0099-12-04");
7131 assert(Date(-999, 12, 4).toISOExtString() == "-0999-12-04");
7132 assert(Date(-9999, 7, 4).toISOExtString() == "-9999-07-04");
7133 assert(Date(-10000, 10, 20).toISOExtString() == "-10000-10-20");
7135 const cdate = Date(1999, 7, 6);
7136 immutable idate = Date(1999, 7, 6);
7142 Converts this $(LREF Date) to a string with the format YYYY-Mon-DD.
7168 assert(Date(2010, 7, 4).toSimpleString() == "2010-Jul-04");
7169 assert(Date(1998, 12, 25).toSimpleString() == "1998-Dec-25");
7170 assert(Date(0, 1, 5).toSimpleString() == "0000-Jan-05");
7171 assert(Date(-4, 1, 5).toSimpleString() == "-0004-Jan-05");
7177 assert(Date(9, 12, 4).toSimpleString() == "0009-Dec-04");
7178 assert(Date(99, 12, 4).toSimpleString() == "0099-Dec-04");
7179 assert(Date(999, 12, 4).toSimpleString() == "0999-Dec-04");
7180 assert(Date(9999, 7, 4).toSimpleString() == "9999-Jul-04");
7181 assert(Date(10000, 10, 20).toSimpleString() == "+10000-Oct-20");
7184 assert(Date(0, 12, 4).toSimpleString() == "0000-Dec-04");
7185 assert(Date(-9, 12, 4).toSimpleString() == "-0009-Dec-04");
7186 assert(Date(-99, 12, 4).toSimpleString() == "-0099-Dec-04");
7187 assert(Date(-999, 12, 4).toSimpleString() == "-0999-Dec-04");
7188 assert(Date(-9999, 7, 4).toSimpleString() == "-9999-Jul-04");
7189 assert(Date(-10000, 10, 20).toSimpleString() == "-10000-Oct-20");
7191 const cdate = Date(1999, 7, 6);
7192 immutable idate = Date(1999, 7, 6);
7199 Converts this $(LREF Date) to a string.
7201 This function exists to make it easy to convert a $(LREF Date) to a
7204 simply convert a $(LREF Date) to a string when using functions such as
7216 $(LREF Date) has no `fromString` function, whereas it does have
7228 auto date = Date(1999, 7, 6);
7229 const cdate = Date(1999, 7, 6);
7230 immutable idate = Date(1999, 7, 6);
7238 Creates a $(LREF Date) from a string with the format YYYYMMDD. Whitespace
7246 not in the ISO format or if the resulting $(LREF Date) would not be
7249 static Date fromISOString(S)(in S isoString) @safe pure
7287 return Date(year, month, day);
7293 assert(Date.fromISOString("20100704") == Date(2010, 7, 4));
7294 assert(Date.fromISOString("19981225") == Date(1998, 12, 25));
7295 assert(Date.fromISOString("00000105") == Date(0, 1, 5));
7296 assert(Date.fromISOString("-00040105") == Date(-4, 1, 5));
7297 assert(Date.fromISOString(" 20100704 ") == Date(2010, 7, 4));
7302 assertThrown!DateTimeException(Date.fromISOString(""));
7303 assertThrown!DateTimeException(Date.fromISOString("990704"));
7304 assertThrown!DateTimeException(Date.fromISOString("0100704"));
7305 assertThrown!DateTimeException(Date.fromISOString("2010070"));
7306 assertThrown!DateTimeException(Date.fromISOString("2010070 "));
7307 assertThrown!DateTimeException(Date.fromISOString("120100704"));
7308 assertThrown!DateTimeException(Date.fromISOString("-0100704"));
7309 assertThrown!DateTimeException(Date.fromISOString("+0100704"));
7310 assertThrown!DateTimeException(Date.fromISOString("2010070a"));
7311 assertThrown!DateTimeException(Date.fromISOString("20100a04"));
7312 assertThrown!DateTimeException(Date.fromISOString("2010a704"));
7314 assertThrown!DateTimeException(Date.fromISOString("99-07-04"));
7315 assertThrown!DateTimeException(Date.fromISOString("010-07-04"));
7316 assertThrown!DateTimeException(Date.fromISOString("2010-07-0"));
7317 assertThrown!DateTimeException(Date.fromISOString("2010-07-0 "));
7318 assertThrown!DateTimeException(Date.fromISOString("12010-07-04"));
7319 assertThrown!DateTimeException(Date.fromISOString("-010-07-04"));
7320 assertThrown!DateTimeException(Date.fromISOString("+010-07-04"));
7321 assertThrown!DateTimeException(Date.fromISOString("2010-07-0a"));
7322 assertThrown!DateTimeException(Date.fromISOString("2010-0a-04"));
7323 assertThrown!DateTimeException(Date.fromISOString("2010-a7-04"));
7324 assertThrown!DateTimeException(Date.fromISOString("2010/07/04"));
7325 assertThrown!DateTimeException(Date.fromISOString("2010/7/04"));
7326 assertThrown!DateTimeException(Date.fromISOString("2010/7/4"));
7327 assertThrown!DateTimeException(Date.fromISOString("2010/07/4"));
7328 assertThrown!DateTimeException(Date.fromISOString("2010-7-04"));
7329 assertThrown!DateTimeException(Date.fromISOString("2010-7-4"));
7330 assertThrown!DateTimeException(Date.fromISOString("2010-07-4"));
7332 assertThrown!DateTimeException(Date.fromISOString("99Jul04"));
7333 assertThrown!DateTimeException(Date.fromISOString("010Jul04"));
7334 assertThrown!DateTimeException(Date.fromISOString("2010Jul0"));
7335 assertThrown!DateTimeException(Date.fromISOString("2010Jul0 "));
7336 assertThrown!DateTimeException(Date.fromISOString("12010Jul04"));
7337 assertThrown!DateTimeException(Date.fromISOString("-010Jul04"));
7338 assertThrown!DateTimeException(Date.fromISOString("+010Jul04"));
7339 assertThrown!DateTimeException(Date.fromISOString("2010Jul0a"));
7340 assertThrown!DateTimeException(Date.fromISOString("2010Jua04"));
7341 assertThrown!DateTimeException(Date.fromISOString("2010aul04"));
7343 assertThrown!DateTimeException(Date.fromISOString("99-Jul-04"));
7344 assertThrown!DateTimeException(Date.fromISOString("010-Jul-04"));
7345 assertThrown!DateTimeException(Date.fromISOString("2010-Jul-0"));
7346 assertThrown!DateTimeException(Date.fromISOString("2010-Jul-0 "));
7347 assertThrown!DateTimeException(Date.fromISOString("12010-Jul-04"));
7348 assertThrown!DateTimeException(Date.fromISOString("-010-Jul-04"));
7349 assertThrown!DateTimeException(Date.fromISOString("+010-Jul-04"));
7350 assertThrown!DateTimeException(Date.fromISOString("2010-Jul-0a"));
7351 assertThrown!DateTimeException(Date.fromISOString("2010-Jua-04"));
7352 assertThrown!DateTimeException(Date.fromISOString("2010-Jal-04"));
7353 assertThrown!DateTimeException(Date.fromISOString("2010-aul-04"));
7355 assertThrown!DateTimeException(Date.fromISOString("2010-07-04"));
7356 assertThrown!DateTimeException(Date.fromISOString("2010-Jul-04"));
7358 assert(Date.fromISOString("19990706") == Date(1999, 7, 6));
7359 assert(Date.fromISOString("-19990706") == Date(-1999, 7, 6));
7360 assert(Date.fromISOString("+019990706") == Date(1999, 7, 6));
7361 assert(Date.fromISOString("19990706 ") == Date(1999, 7, 6));
7362 assert(Date.fromISOString(" 19990706") == Date(1999, 7, 6));
7363 assert(Date.fromISOString(" 19990706 ") == Date(1999, 7, 6));
7374 assert(Date.fromISOString(to!S("20121221")) == Date(2012, 12, 21));
7380 Creates a $(LREF Date) from a string with the format YYYY-MM-DD.
7389 not in the ISO Extended format or if the resulting $(LREF Date)
7392 static Date fromISOExtString(S)(in S isoExtString) @safe pure
7428 return Date(to!short(year), to!ubyte(month), to!ubyte(day));
7434 assert(Date.fromISOExtString("2010-07-04") == Date(2010, 7, 4));
7435 assert(Date.fromISOExtString("1998-12-25") == Date(1998, 12, 25));
7436 assert(Date.fromISOExtString("0000-01-05") == Date(0, 1, 5));
7437 assert(Date.fromISOExtString("-0004-01-05") == Date(-4, 1, 5));
7438 assert(Date.fromISOExtString(" 2010-07-04 ") == Date(2010, 7, 4));
7443 assertThrown!DateTimeException(Date.fromISOExtString(""));
7444 assertThrown!DateTimeException(Date.fromISOExtString("990704"));
7445 assertThrown!DateTimeException(Date.fromISOExtString("0100704"));
7446 assertThrown!DateTimeException(Date.fromISOExtString("2010070"));
7447 assertThrown!DateTimeException(Date.fromISOExtString("2010070 "));
7448 assertThrown!DateTimeException(Date.fromISOExtString("120100704"));
7449 assertThrown!DateTimeException(Date.fromISOExtString("-0100704"));
7450 assertThrown!DateTimeException(Date.fromISOExtString("+0100704"));
7451 assertThrown!DateTimeException(Date.fromISOExtString("2010070a"));
7452 assertThrown!DateTimeException(Date.fromISOExtString("20100a04"));
7453 assertThrown!DateTimeException(Date.fromISOExtString("2010a704"));
7455 assertThrown!DateTimeException(Date.fromISOExtString("99-07-04"));
7456 assertThrown!DateTimeException(Date.fromISOExtString("010-07-04"));
7457 assertThrown!DateTimeException(Date.fromISOExtString("2010-07-0"));
7458 assertThrown!DateTimeException(Date.fromISOExtString("2010-07-0 "));
7459 assertThrown!DateTimeException(Date.fromISOExtString("12010-07-04"));
7460 assertThrown!DateTimeException(Date.fromISOExtString("-010-07-04"));
7461 assertThrown!DateTimeException(Date.fromISOExtString("+010-07-04"));
7462 assertThrown!DateTimeException(Date.fromISOExtString("2010-07-0a"));
7463 assertThrown!DateTimeException(Date.fromISOExtString("2010-0a-04"));
7464 assertThrown!DateTimeException(Date.fromISOExtString("2010-a7-04"));
7465 assertThrown!DateTimeException(Date.fromISOExtString("2010/07/04"));
7466 assertThrown!DateTimeException(Date.fromISOExtString("2010/7/04"));
7467 assertThrown!DateTimeException(Date.fromISOExtString("2010/7/4"));
7468 assertThrown!DateTimeException(Date.fromISOExtString("2010/07/4"));
7469 assertThrown!DateTimeException(Date.fromISOExtString("2010-7-04"));
7470 assertThrown!DateTimeException(Date.fromISOExtString("2010-7-4"));
7471 assertThrown!DateTimeException(Date.fromISOExtString("2010-07-4"));
7473 assertThrown!DateTimeException(Date.fromISOExtString("99Jul04"));
7474 assertThrown!DateTimeException(Date.fromISOExtString("010Jul04"));
7475 assertThrown!DateTimeException(Date.fromISOExtString("2010Jul0"));
7476 assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-0 "));
7477 assertThrown!DateTimeException(Date.fromISOExtString("12010Jul04"));
7478 assertThrown!DateTimeException(Date.fromISOExtString("-010Jul04"));
7479 assertThrown!DateTimeException(Date.fromISOExtString("+010Jul04"));
7480 assertThrown!DateTimeException(Date.fromISOExtString("2010Jul0a"));
7481 assertThrown!DateTimeException(Date.fromISOExtString("2010Jua04"));
7482 assertThrown!DateTimeException(Date.fromISOExtString("2010aul04"));
7484 assertThrown!DateTimeException(Date.fromISOExtString("99-Jul-04"));
7485 assertThrown!DateTimeException(Date.fromISOExtString("010-Jul-04"));
7486 assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-0"));
7487 assertThrown!DateTimeException(Date.fromISOExtString("2010Jul0 "));
7488 assertThrown!DateTimeException(Date.fromISOExtString("12010-Jul-04"));
7489 assertThrown!DateTimeException(Date.fromISOExtString("-010-Jul-04"));
7490 assertThrown!DateTimeException(Date.fromISOExtString("+010-Jul-04"));
7491 assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-0a"));
7492 assertThrown!DateTimeException(Date.fromISOExtString("2010-Jua-04"));
7493 assertThrown!DateTimeException(Date.fromISOExtString("2010-Jal-04"));
7494 assertThrown!DateTimeException(Date.fromISOExtString("2010-aul-04"));
7496 assertThrown!DateTimeException(Date.fromISOExtString("20100704"));
7497 assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-04"));
7499 assert(Date.fromISOExtString("1999-07-06") == Date(1999, 7, 6));
7500 assert(Date.fromISOExtString("-1999-07-06") == Date(-1999, 7, 6));
7501 assert(Date.fromISOExtString("+01999-07-06") == Date(1999, 7, 6));
7502 assert(Date.fromISOExtString("1999-07-06 ") == Date(1999, 7, 6));
7503 assert(Date.fromISOExtString(" 1999-07-06") == Date(1999, 7, 6));
7504 assert(Date.fromISOExtString(" 1999-07-06 ") == Date(1999, 7, 6));
7515 assert(Date.fromISOExtString(to!S("2012-12-21")) == Date(2012, 12, 21));
7521 Creates a $(LREF Date) from a string with the format YYYY-Mon-DD.
7530 not in the correct format or if the resulting $(LREF Date) would not
7533 static Date fromSimpleString(S)(in S simpleString) @safe pure
7566 return Date(to!short(year), month, to!ubyte(day));
7572 assert(Date.fromSimpleString("2010-Jul-04") == Date(2010, 7, 4));
7573 assert(Date.fromSimpleString("1998-Dec-25") == Date(1998, 12, 25));
7574 assert(Date.fromSimpleString("0000-Jan-05") == Date(0, 1, 5));
7575 assert(Date.fromSimpleString("-0004-Jan-05") == Date(-4, 1, 5));
7576 assert(Date.fromSimpleString(" 2010-Jul-04 ") == Date(2010, 7, 4));
7581 assertThrown!DateTimeException(Date.fromSimpleString(""));
7582 assertThrown!DateTimeException(Date.fromSimpleString("990704"));
7583 assertThrown!DateTimeException(Date.fromSimpleString("0100704"));
7584 assertThrown!DateTimeException(Date.fromSimpleString("2010070"));
7585 assertThrown!DateTimeException(Date.fromSimpleString("2010070 "));
7586 assertThrown!DateTimeException(Date.fromSimpleString("120100704"));
7587 assertThrown!DateTimeException(Date.fromSimpleString("-0100704"));
7588 assertThrown!DateTimeException(Date.fromSimpleString("+0100704"));
7589 assertThrown!DateTimeException(Date.fromSimpleString("2010070a"));
7590 assertThrown!DateTimeException(Date.fromSimpleString("20100a04"));
7591 assertThrown!DateTimeException(Date.fromSimpleString("2010a704"));
7593 assertThrown!DateTimeException(Date.fromSimpleString("99-07-04"));
7594 assertThrown!DateTimeException(Date.fromSimpleString("010-07-04"));
7595 assertThrown!DateTimeException(Date.fromSimpleString("2010-07-0"));
7596 assertThrown!DateTimeException(Date.fromSimpleString("2010-07-0 "));
7597 assertThrown!DateTimeException(Date.fromSimpleString("12010-07-04"));
7598 assertThrown!DateTimeException(Date.fromSimpleString("-010-07-04"));
7599 assertThrown!DateTimeException(Date.fromSimpleString("+010-07-04"));
7600 assertThrown!DateTimeException(Date.fromSimpleString("2010-07-0a"));
7601 assertThrown!DateTimeException(Date.fromSimpleString("2010-0a-04"));
7602 assertThrown!DateTimeException(Date.fromSimpleString("2010-a7-04"));
7603 assertThrown!DateTimeException(Date.fromSimpleString("2010/07/04"));
7604 assertThrown!DateTimeException(Date.fromSimpleString("2010/7/04"));
7605 assertThrown!DateTimeException(Date.fromSimpleString("2010/7/4"));
7606 assertThrown!DateTimeException(Date.fromSimpleString("2010/07/4"));
7607 assertThrown!DateTimeException(Date.fromSimpleString("2010-7-04"));
7608 assertThrown!DateTimeException(Date.fromSimpleString("2010-7-4"));
7609 assertThrown!DateTimeException(Date.fromSimpleString("2010-07-4"));
7611 assertThrown!DateTimeException(Date.fromSimpleString("99Jul04"));
7612 assertThrown!DateTimeException(Date.fromSimpleString("010Jul04"));
7613 assertThrown!DateTimeException(Date.fromSimpleString("2010Jul0"));
7614 assertThrown!DateTimeException(Date.fromSimpleString("2010Jul0 "));
7615 assertThrown!DateTimeException(Date.fromSimpleString("12010Jul04"));
7616 assertThrown!DateTimeException(Date.fromSimpleString("-010Jul04"));
7617 assertThrown!DateTimeException(Date.fromSimpleString("+010Jul04"));
7618 assertThrown!DateTimeException(Date.fromSimpleString("2010Jul0a"));
7619 assertThrown!DateTimeException(Date.fromSimpleString("2010Jua04"));
7620 assertThrown!DateTimeException(Date.fromSimpleString("2010aul04"));
7622 assertThrown!DateTimeException(Date.fromSimpleString("99-Jul-04"));
7623 assertThrown!DateTimeException(Date.fromSimpleString("010-Jul-04"));
7624 assertThrown!DateTimeException(Date.fromSimpleString("2010-Jul-0"));
7625 assertThrown!DateTimeException(Date.fromSimpleString("2010-Jul-0 "));
7626 assertThrown!DateTimeException(Date.fromSimpleString("12010-Jul-04"));
7627 assertThrown!DateTimeException(Date.fromSimpleString("-010-Jul-04"));
7628 assertThrown!DateTimeException(Date.fromSimpleString("+010-Jul-04"));
7629 assertThrown!DateTimeException(Date.fromSimpleString("2010-Jul-0a"));
7630 assertThrown!DateTimeException(Date.fromSimpleString("2010-Jua-04"));
7631 assertThrown!DateTimeException(Date.fromSimpleString("2010-Jal-04"));
7632 assertThrown!DateTimeException(Date.fromSimpleString("2010-aul-04"));
7634 assertThrown!DateTimeException(Date.fromSimpleString("20100704"));
7635 assertThrown!DateTimeException(Date.fromSimpleString("2010-07-04"));
7637 assert(Date.fromSimpleString("1999-Jul-06") == Date(1999, 7, 6));
7638 assert(Date.fromSimpleString("-1999-Jul-06") == Date(-1999, 7, 6));
7639 assert(Date.fromSimpleString("+01999-Jul-06") == Date(1999, 7, 6));
7640 assert(Date.fromSimpleString("1999-Jul-06 ") == Date(1999, 7, 6));
7641 assert(Date.fromSimpleString(" 1999-Jul-06") == Date(1999, 7, 6));
7642 assert(Date.fromSimpleString(" 1999-Jul-06 ") == Date(1999, 7, 6));
7653 assert(Date.fromSimpleString(to!S("2012-Dec-21")) == Date(2012, 12, 21));
7659 Returns the $(LREF Date) farthest in the past which is representable by
7660 $(LREF Date).
7662 @property static Date min() @safe pure nothrow @nogc in min()
7664 auto date = Date.init; in min()
7674 assert(Date.min.year < 0);
7675 assert(Date.min < Date.max);
7680 Returns the $(LREF Date) farthest in the future which is representable
7681 by $(LREF Date).
7683 @property static Date max() @safe pure nothrow @nogc in max()
7685 auto date = Date.init; in max()
7695 assert(Date.max.year > 0);
7696 assert(Date.max > Date.min);
7721 Adds the given number of days to this $(LREF Date). A negative number
7734 days = The number of days to add to this Date.
7736 ref Date _addDays(long days) return @safe pure nothrow @nogc
7746 auto date = Date(1999, 2, 28);
7748 assert(date == Date(1999, 3, 1));
7750 assert(date == Date(1999, 2, 28));
7754 auto date = Date(2000, 2, 28);
7756 assert(date == Date(2000, 2, 29));
7758 assert(date == Date(2000, 3, 1));
7760 assert(date == Date(2000, 2, 29));
7764 auto date = Date(1999, 6, 30);
7766 assert(date == Date(1999, 7, 1));
7768 assert(date == Date(1999, 6, 30));
7772 auto date = Date(1999, 7, 31);
7774 assert(date == Date(1999, 8, 1));
7776 assert(date == Date(1999, 7, 31));
7780 auto date = Date(1999, 1, 1);
7782 assert(date == Date(1998, 12, 31));
7784 assert(date == Date(1999, 1, 1));
7788 auto date = Date(1999, 7, 6);
7790 assert(date == Date(1999, 7, 15));
7792 assert(date == Date(1999, 7, 4));
7794 assert(date == Date(1999, 8, 3));
7796 assert(date == Date(1999, 7, 31));
7800 auto date = Date(1999, 7, 6);
7802 assert(date == Date(2000, 7, 5));
7804 assert(date == Date(1999, 7, 6));
7806 assert(date == Date(2000, 7, 6));
7808 assert(date == Date(2002, 7, 6));
7810 assert(date == Date(1999, 7, 6));
7815 auto date = Date(-1999, 2, 28);
7817 assert(date == Date(-1999, 3, 1));
7819 assert(date == Date(-1999, 2, 28));
7823 auto date = Date(-2000, 2, 28);
7825 assert(date == Date(-2000, 2, 29));
7827 assert(date == Date(-2000, 3, 1));
7829 assert(date == Date(-2000, 2, 29));
7833 auto date = Date(-1999, 6, 30);
7835 assert(date == Date(-1999, 7, 1));
7837 assert(date == Date(-1999, 6, 30));
7841 auto date = Date(-1999, 7, 31);
7843 assert(date == Date(-1999, 8, 1));
7845 assert(date == Date(-1999, 7, 31));
7849 auto date = Date(-1999, 1, 1);
7851 assert(date == Date(-2000, 12, 31));
7853 assert(date == Date(-1999, 1, 1));
7857 auto date = Date(-1999, 7, 6);
7859 assert(date == Date(-1999, 7, 15));
7861 assert(date == Date(-1999, 7, 4));
7863 assert(date == Date(-1999, 8, 3));
7868 auto date = Date(-1999, 7, 6);
7870 assert(date == Date(-1998, 7, 6));
7872 assert(date == Date(-1999, 7, 6));
7874 assert(date == Date(-1998, 7, 7));
7876 assert(date == Date(-1996, 7, 6));
7878 assert(date == Date(-1999, 7, 6));
7883 auto date = Date(1, 7, 6);
7885 assert(date == Date(0, 7, 6));
7887 assert(date == Date(1, 7, 6));
7889 assert(date == Date(-1, 7, 6));
7891 assert(date == Date(1, 7, 5));
7894 const cdate = Date(1999, 7, 6);
7895 immutable idate = Date(1999, 7, 6);
9584 static assert(isTimePoint!Date);
9601 foreach (TP; AliasSeq!(Date, DateTime, SysTime, TimeOfDay))
9607 …each (T; AliasSeq!(float, string, Duration, Interval!Date, PosInfInterval!Date, NegInfInterval!Dat…
10122 Date[] testDatesBC;
10123 Date[] testDatesAD;
10129 struct GregDay { int day; Date date; }
10130 auto testGregDaysBC = [GregDay(-1_373_427, Date(-3760, 9, 7)), // Start of the Hebrew Calendar
10131 GregDay(-735_233, Date(-2012, 1, 1)),
10132 GregDay(-735_202, Date(-2012, 2, 1)),
10133 GregDay(-735_175, Date(-2012, 2, 28)),
10134 GregDay(-735_174, Date(-2012, 2, 29)),
10135 GregDay(-735_173, Date(-2012, 3, 1)),
10136 GregDay(-734_502, Date(-2010, 1, 1)),
10137 GregDay(-734_472, Date(-2010, 1, 31)),
10138 GregDay(-734_471, Date(-2010, 2, 1)),
10139 GregDay(-734_444, Date(-2010, 2, 28)),
10140 GregDay(-734_443, Date(-2010, 3, 1)),
10141 GregDay(-734_413, Date(-2010, 3, 31)),
10142 GregDay(-734_412, Date(-2010, 4, 1)),
10143 GregDay(-734_383, Date(-2010, 4, 30)),
10144 GregDay(-734_382, Date(-2010, 5, 1)),
10145 GregDay(-734_352, Date(-2010, 5, 31)),
10146 GregDay(-734_351, Date(-2010, 6, 1)),
10147 GregDay(-734_322, Date(-2010, 6, 30)),
10148 GregDay(-734_321, Date(-2010, 7, 1)),
10149 GregDay(-734_291, Date(-2010, 7, 31)),
10150 GregDay(-734_290, Date(-2010, 8, 1)),
10151 GregDay(-734_260, Date(-2010, 8, 31)),
10152 GregDay(-734_259, Date(-2010, 9, 1)),
10153 GregDay(-734_230, Date(-2010, 9, 30)),
10154 GregDay(-734_229, Date(-2010, 10, 1)),
10155 GregDay(-734_199, Date(-2010, 10, 31)),
10156 GregDay(-734_198, Date(-2010, 11, 1)),
10157 GregDay(-734_169, Date(-2010, 11, 30)),
10158 GregDay(-734_168, Date(-2010, 12, 1)),
10159 GregDay(-734_139, Date(-2010, 12, 30)),
10160 GregDay(-734_138, Date(-2010, 12, 31)),
10161 GregDay(-731_215, Date(-2001, 1, 1)),
10162 GregDay(-730_850, Date(-2000, 1, 1)),
10163 GregDay(-730_849, Date(-2000, 1, 2)),
10164 GregDay(-730_486, Date(-2000, 12, 30)),
10165 GregDay(-730_485, Date(-2000, 12, 31)),
10166 GregDay(-730_484, Date(-1999, 1, 1)),
10167 GregDay(-694_690, Date(-1901, 1, 1)),
10168 GregDay(-694_325, Date(-1900, 1, 1)),
10169 GregDay(-585_118, Date(-1601, 1, 1)),
10170 GregDay(-584_753, Date(-1600, 1, 1)),
10171 GregDay(-584_388, Date(-1600, 12, 31)),
10172 GregDay(-584_387, Date(-1599, 1, 1)),
10173 GregDay(-365_972, Date(-1001, 1, 1)),
10174 GregDay(-365_607, Date(-1000, 1, 1)),
10175 GregDay(-183_351, Date(-501, 1, 1)),
10176 GregDay(-182_986, Date(-500, 1, 1)),
10177 GregDay(-182_621, Date(-499, 1, 1)),
10178 GregDay(-146_827, Date(-401, 1, 1)),
10179 GregDay(-146_462, Date(-400, 1, 1)),
10180 GregDay(-146_097, Date(-400, 12, 31)),
10181 GregDay(-110_302, Date(-301, 1, 1)),
10182 GregDay(-109_937, Date(-300, 1, 1)),
10183 GregDay(-73_778, Date(-201, 1, 1)),
10184 GregDay(-73_413, Date(-200, 1, 1)),
10185 GregDay(-38_715, Date(-105, 1, 1)),
10186 GregDay(-37_254, Date(-101, 1, 1)),
10187 GregDay(-36_889, Date(-100, 1, 1)),
10188 GregDay(-36_524, Date(-99, 1, 1)),
10189 GregDay(-36_160, Date(-99, 12, 31)),
10190 GregDay(-35_794, Date(-97, 1, 1)),
10191 GregDay(-18_627, Date(-50, 1, 1)),
10192 GregDay(-18_262, Date(-49, 1, 1)),
10193 GregDay(-3652, Date(-9, 1, 1)),
10194 GregDay(-2191, Date(-5, 1, 1)),
10195 GregDay(-1827, Date(-5, 12, 31)),
10196 GregDay(-1826, Date(-4, 1, 1)),
10197 GregDay(-1825, Date(-4, 1, 2)),
10198 GregDay(-1462, Date(-4, 12, 30)),
10199 GregDay(-1461, Date(-4, 12, 31)),
10200 GregDay(-1460, Date(-3, 1, 1)),
10201 GregDay(-1096, Date(-3, 12, 31)),
10202 GregDay(-1095, Date(-2, 1, 1)),
10203 GregDay(-731, Date(-2, 12, 31)),
10204 GregDay(-730, Date(-1, 1, 1)),
10205 GregDay(-367, Date(-1, 12, 30)),
10206 GregDay(-366, Date(-1, 12, 31)),
10207 GregDay(-365, Date(0, 1, 1)),
10208 GregDay(-31, Date(0, 11, 30)),
10209 GregDay(-30, Date(0, 12, 1)),
10210 GregDay(-1, Date(0, 12, 30)),
10211 GregDay(0, Date(0, 12, 31))];
10213 auto testGregDaysAD = [GregDay(1, Date(1, 1, 1)),
10214 GregDay(2, Date(1, 1, 2)),
10215 GregDay(32, Date(1, 2, 1)),
10216 GregDay(365, Date(1, 12, 31)),
10217 GregDay(366, Date(2, 1, 1)),
10218 GregDay(731, Date(3, 1, 1)),
10219 GregDay(1096, Date(4, 1, 1)),
10220 GregDay(1097, Date(4, 1, 2)),
10221 GregDay(1460, Date(4, 12, 30)),
10222 GregDay(1461, Date(4, 12, 31)),
10223 GregDay(1462, Date(5, 1, 1)),
10224 GregDay(17_898, Date(50, 1, 1)),
10225 GregDay(35_065, Date(97, 1, 1)),
10226 GregDay(36_160, Date(100, 1, 1)),
10227 GregDay(36_525, Date(101, 1, 1)),
10228 GregDay(37_986, Date(105, 1, 1)),
10229 GregDay(72_684, Date(200, 1, 1)),
10230 GregDay(73_049, Date(201, 1, 1)),
10231 GregDay(109_208, Date(300, 1, 1)),
10232 GregDay(109_573, Date(301, 1, 1)),
10233 GregDay(145_732, Date(400, 1, 1)),
10234 GregDay(146_098, Date(401, 1, 1)),
10235 GregDay(182_257, Date(500, 1, 1)),
10236 GregDay(182_622, Date(501, 1, 1)),
10237 GregDay(364_878, Date(1000, 1, 1)),
10238 GregDay(365_243, Date(1001, 1, 1)),
10239 GregDay(584_023, Date(1600, 1, 1)),
10240 GregDay(584_389, Date(1601, 1, 1)),
10241 GregDay(693_596, Date(1900, 1, 1)),
10242 GregDay(693_961, Date(1901, 1, 1)),
10243 GregDay(729_755, Date(1999, 1, 1)),
10244 GregDay(730_120, Date(2000, 1, 1)),
10245 GregDay(730_121, Date(2000, 1, 2)),
10246 GregDay(730_484, Date(2000, 12, 30)),
10247 GregDay(730_485, Date(2000, 12, 31)),
10248 GregDay(730_486, Date(2001, 1, 1)),
10249 GregDay(733_773, Date(2010, 1, 1)),
10250 GregDay(733_774, Date(2010, 1, 2)),
10251 GregDay(733_803, Date(2010, 1, 31)),
10252 GregDay(733_804, Date(2010, 2, 1)),
10253 GregDay(733_831, Date(2010, 2, 28)),
10254 GregDay(733_832, Date(2010, 3, 1)),
10255 GregDay(733_862, Date(2010, 3, 31)),
10256 GregDay(733_863, Date(2010, 4, 1)),
10257 GregDay(733_892, Date(2010, 4, 30)),
10258 GregDay(733_893, Date(2010, 5, 1)),
10259 GregDay(733_923, Date(2010, 5, 31)),
10260 GregDay(733_924, Date(2010, 6, 1)),
10261 GregDay(733_953, Date(2010, 6, 30)),
10262 GregDay(733_954, Date(2010, 7, 1)),
10263 GregDay(733_984, Date(2010, 7, 31)),
10264 GregDay(733_985, Date(2010, 8, 1)),
10265 GregDay(734_015, Date(2010, 8, 31)),
10266 GregDay(734_016, Date(2010, 9, 1)),
10267 GregDay(734_045, Date(2010, 9, 30)),
10268 GregDay(734_046, Date(2010, 10, 1)),
10269 GregDay(734_076, Date(2010, 10, 31)),
10270 GregDay(734_077, Date(2010, 11, 1)),
10271 GregDay(734_106, Date(2010, 11, 30)),
10272 GregDay(734_107, Date(2010, 12, 1)),
10273 GregDay(734_136, Date(2010, 12, 30)),
10274 GregDay(734_137, Date(2010, 12, 31)),
10275 GregDay(734_503, Date(2012, 1, 1)),
10276 GregDay(734_534, Date(2012, 2, 1)),
10277 GregDay(734_561, Date(2012, 2, 28)),
10278 GregDay(734_562, Date(2012, 2, 29)),
10279 GregDay(734_563, Date(2012, 3, 1)),
10280 GregDay(734_858, Date(2012, 12, 21))];
10348 testDatesBC ~= Date(year, md.month, md.day);
10354 testDatesAD ~= Date(year, md.month, md.day);