mscorlib(4.0.0.0) API with additions
UmAlQuraCalendar.cs
1 namespace System.Globalization
2 {
5  public class UmAlQuraCalendar : Calendar
6  {
7  internal struct DateMapping
8  {
9  internal int HijriMonthsLengthFlags;
10 
11  internal DateTime GregorianDate;
12 
13  internal DateMapping(int MonthsLengthFlags, int GYear, int GMonth, int GDay)
14  {
15  HijriMonthsLengthFlags = MonthsLengthFlags;
16  GregorianDate = new DateTime(GYear, GMonth, GDay);
17  }
18  }
19 
20  internal const int MinCalendarYear = 1318;
21 
22  internal const int MaxCalendarYear = 1500;
23 
24  private static readonly DateMapping[] HijriYearInfo = InitDateMapping();
25 
27  public const int UmAlQuraEra = 1;
28 
29  internal const int DateCycle = 30;
30 
31  internal const int DatePartYear = 0;
32 
33  internal const int DatePartDayOfYear = 1;
34 
35  internal const int DatePartMonth = 2;
36 
37  internal const int DatePartDay = 3;
38 
39  internal static DateTime minDate = new DateTime(1900, 4, 30);
40 
41  internal static DateTime maxDate = new DateTime(new DateTime(2077, 11, 16, 23, 59, 59, 999).Ticks + 9999);
42 
43  private const int DEFAULT_TWO_DIGIT_YEAR_MAX = 1451;
44 
47  public override DateTime MinSupportedDateTime => minDate;
48 
51  public override DateTime MaxSupportedDateTime => maxDate;
52 
55  public override CalendarAlgorithmType AlgorithmType => CalendarAlgorithmType.LunarCalendar;
56 
57  internal override int BaseCalendarID => 6;
58 
59  internal override int ID => 23;
60 
63  protected override int DaysInYearBeforeMinSupportedYear => 355;
64 
67  public override int[] Eras => new int[1]
68  {
69  1
70  };
71 
76  public override int TwoDigitYearMax
77  {
78  get
79  {
80  if (twoDigitYearMax == -1)
81  {
82  twoDigitYearMax = Calendar.GetSystemTwoDigitYearSetting(ID, 1451);
83  }
84  return twoDigitYearMax;
85  }
86  set
87  {
88  if (value != 99 && (value < 1318 || value > 1500))
89  {
90  throw new ArgumentOutOfRangeException("value", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1318, 1500));
91  }
92  VerifyWritable();
93  twoDigitYearMax = value;
94  }
95  }
96 
97  private static DateMapping[] InitDateMapping()
98  {
99  short[] array = new short[736]
100  {
101  746,
102  1900,
103  4,
104  30,
105  1769,
106  1901,
107  4,
108  19,
109  3794,
110  1902,
111  4,
112  9,
113  3748,
114  1903,
115  3,
116  30,
117  3402,
118  1904,
119  3,
120  18,
121  2710,
122  1905,
123  3,
124  7,
125  1334,
126  1906,
127  2,
128  24,
129  2741,
130  1907,
131  2,
132  13,
133  3498,
134  1908,
135  2,
136  3,
137  2980,
138  1909,
139  1,
140  23,
141  2889,
142  1910,
143  1,
144  12,
145  2707,
146  1911,
147  1,
148  1,
149  1323,
150  1911,
151  12,
152  21,
153  2647,
154  1912,
155  12,
156  9,
157  1206,
158  1913,
159  11,
160  29,
161  2741,
162  1914,
163  11,
164  18,
165  1450,
166  1915,
167  11,
168  8,
169  3413,
170  1916,
171  10,
172  27,
173  3370,
174  1917,
175  10,
176  17,
177  2646,
178  1918,
179  10,
180  6,
181  1198,
182  1919,
183  9,
184  25,
185  2397,
186  1920,
187  9,
188  13,
189  748,
190  1921,
191  9,
192  3,
193  1749,
194  1922,
195  8,
196  23,
197  1706,
198  1923,
199  8,
200  13,
201  1365,
202  1924,
203  8,
204  1,
205  1195,
206  1925,
207  7,
208  21,
209  2395,
210  1926,
211  7,
212  10,
213  698,
214  1927,
215  6,
216  30,
217  1397,
218  1928,
219  6,
220  18,
221  2994,
222  1929,
223  6,
224  8,
225  1892,
226  1930,
227  5,
228  29,
229  1865,
230  1931,
231  5,
232  18,
233  1621,
234  1932,
235  5,
236  6,
237  683,
238  1933,
239  4,
240  25,
241  1371,
242  1934,
243  4,
244  14,
245  2778,
246  1935,
247  4,
248  4,
249  1748,
250  1936,
251  3,
252  24,
253  3785,
254  1937,
255  3,
256  13,
257  3474,
258  1938,
259  3,
260  3,
261  3365,
262  1939,
263  2,
264  20,
265  2637,
266  1940,
267  2,
268  9,
269  685,
270  1941,
271  1,
272  28,
273  1389,
274  1942,
275  1,
276  17,
277  2922,
278  1943,
279  1,
280  7,
281  2898,
282  1943,
283  12,
284  28,
285  2725,
286  1944,
287  12,
288  16,
289  2635,
290  1945,
291  12,
292  5,
293  1175,
294  1946,
295  11,
296  24,
297  2359,
298  1947,
299  11,
300  13,
301  694,
302  1948,
303  11,
304  2,
305  1397,
306  1949,
307  10,
308  22,
309  3434,
310  1950,
311  10,
312  12,
313  3410,
314  1951,
315  10,
316  2,
317  2710,
318  1952,
319  9,
320  20,
321  2349,
322  1953,
323  9,
324  9,
325  605,
326  1954,
327  8,
328  29,
329  1245,
330  1955,
331  8,
332  18,
333  2778,
334  1956,
335  8,
336  7,
337  1492,
338  1957,
339  7,
340  28,
341  3497,
342  1958,
343  7,
344  17,
345  3410,
346  1959,
347  7,
348  7,
349  2730,
350  1960,
351  6,
352  25,
353  1238,
354  1961,
355  6,
356  14,
357  2486,
358  1962,
359  6,
360  3,
361  884,
362  1963,
363  5,
364  24,
365  1897,
366  1964,
367  5,
368  12,
369  1874,
370  1965,
371  5,
372  2,
373  1701,
374  1966,
375  4,
376  21,
377  1355,
378  1967,
379  4,
380  10,
381  2731,
382  1968,
383  3,
384  29,
385  1370,
386  1969,
387  3,
388  19,
389  2773,
390  1970,
391  3,
392  8,
393  3538,
394  1971,
395  2,
396  26,
397  3492,
398  1972,
399  2,
400  16,
401  3401,
402  1973,
403  2,
404  4,
405  2709,
406  1974,
407  1,
408  24,
409  1325,
410  1975,
411  1,
412  13,
413  2653,
414  1976,
415  1,
416  2,
417  1370,
418  1976,
419  12,
420  22,
421  2773,
422  1977,
423  12,
424  11,
425  1706,
426  1978,
427  12,
428  1,
429  1685,
430  1979,
431  11,
432  20,
433  1323,
434  1980,
435  11,
436  8,
437  2647,
438  1981,
439  10,
440  28,
441  1198,
442  1982,
443  10,
444  18,
445  2422,
446  1983,
447  10,
448  7,
449  1388,
450  1984,
451  9,
452  26,
453  2901,
454  1985,
455  9,
456  15,
457  2730,
458  1986,
459  9,
460  5,
461  2645,
462  1987,
463  8,
464  25,
465  1197,
466  1988,
467  8,
468  13,
469  2397,
470  1989,
471  8,
472  2,
473  730,
474  1990,
475  7,
476  23,
477  1497,
478  1991,
479  7,
480  12,
481  3506,
482  1992,
483  7,
484  1,
485  2980,
486  1993,
487  6,
488  21,
489  2890,
490  1994,
491  6,
492  10,
493  2645,
494  1995,
495  5,
496  30,
497  693,
498  1996,
499  5,
500  18,
501  1397,
502  1997,
503  5,
504  7,
505  2922,
506  1998,
507  4,
508  27,
509  3026,
510  1999,
511  4,
512  17,
513  3012,
514  2000,
515  4,
516  6,
517  2953,
518  2001,
519  3,
520  26,
521  2709,
522  2002,
523  3,
524  15,
525  1325,
526  2003,
527  3,
528  4,
529  1453,
530  2004,
531  2,
532  21,
533  2922,
534  2005,
535  2,
536  10,
537  1748,
538  2006,
539  1,
540  31,
541  3529,
542  2007,
543  1,
544  20,
545  3474,
546  2008,
547  1,
548  10,
549  2726,
550  2008,
551  12,
552  29,
553  2390,
554  2009,
555  12,
556  18,
557  686,
558  2010,
559  12,
560  7,
561  1389,
562  2011,
563  11,
564  26,
565  874,
566  2012,
567  11,
568  15,
569  2901,
570  2013,
571  11,
572  4,
573  2730,
574  2014,
575  10,
576  25,
577  2381,
578  2015,
579  10,
580  14,
581  1181,
582  2016,
583  10,
584  2,
585  2397,
586  2017,
587  9,
588  21,
589  698,
590  2018,
591  9,
592  11,
593  1461,
594  2019,
595  8,
596  31,
597  1450,
598  2020,
599  8,
600  20,
601  3413,
602  2021,
603  8,
604  9,
605  2714,
606  2022,
607  7,
608  30,
609  2350,
610  2023,
611  7,
612  19,
613  622,
614  2024,
615  7,
616  7,
617  1373,
618  2025,
619  6,
620  26,
621  2778,
622  2026,
623  6,
624  16,
625  1748,
626  2027,
627  6,
628  6,
629  1701,
630  2028,
631  5,
632  25,
633  1355,
634  2029,
635  5,
636  14,
637  2711,
638  2030,
639  5,
640  3,
641  1358,
642  2031,
643  4,
644  23,
645  2734,
646  2032,
647  4,
648  11,
649  1452,
650  2033,
651  4,
652  1,
653  2985,
654  2034,
655  3,
656  21,
657  3474,
658  2035,
659  3,
660  11,
661  2853,
662  2036,
663  2,
664  28,
665  1611,
666  2037,
667  2,
668  16,
669  3243,
670  2038,
671  2,
672  5,
673  1370,
674  2039,
675  1,
676  26,
677  2901,
678  2040,
679  1,
680  15,
681  1746,
682  2041,
683  1,
684  4,
685  3749,
686  2041,
687  12,
688  24,
689  3658,
690  2042,
691  12,
692  14,
693  2709,
694  2043,
695  12,
696  3,
697  1325,
698  2044,
699  11,
700  21,
701  2733,
702  2045,
703  11,
704  10,
705  876,
706  2046,
707  10,
708  31,
709  1881,
710  2047,
711  10,
712  20,
713  1746,
714  2048,
715  10,
716  9,
717  1685,
718  2049,
719  9,
720  28,
721  1325,
722  2050,
723  9,
724  17,
725  2651,
726  2051,
727  9,
728  6,
729  1210,
730  2052,
731  8,
732  26,
733  2490,
734  2053,
735  8,
736  15,
737  948,
738  2054,
739  8,
740  5,
741  2921,
742  2055,
743  7,
744  25,
745  2898,
746  2056,
747  7,
748  14,
749  2726,
750  2057,
751  7,
752  3,
753  1206,
754  2058,
755  6,
756  22,
757  2413,
758  2059,
759  6,
760  11,
761  748,
762  2060,
763  5,
764  31,
765  1753,
766  2061,
767  5,
768  20,
769  3762,
770  2062,
771  5,
772  10,
773  3412,
774  2063,
775  4,
776  30,
777  3370,
778  2064,
779  4,
780  18,
781  2646,
782  2065,
783  4,
784  7,
785  1198,
786  2066,
787  3,
788  27,
789  2413,
790  2067,
791  3,
792  16,
793  3434,
794  2068,
795  3,
796  5,
797  2900,
798  2069,
799  2,
800  23,
801  2857,
802  2070,
803  2,
804  12,
805  2707,
806  2071,
807  2,
808  1,
809  1323,
810  2072,
811  1,
812  21,
813  2647,
814  2073,
815  1,
816  9,
817  1334,
818  2073,
819  12,
820  30,
821  2741,
822  2074,
823  12,
824  19,
825  1706,
826  2075,
827  12,
828  9,
829  3731,
830  2076,
831  11,
832  27,
833  0,
834  2077,
835  11,
836  17
837  };
838  DateMapping[] array2 = new DateMapping[array.Length / 4];
839  for (int i = 0; i < array2.Length; i++)
840  {
841  array2[i] = new DateMapping(array[i * 4], array[i * 4 + 1], array[i * 4 + 2], array[i * 4 + 3]);
842  }
843  return array2;
844  }
845 
846  private static void ConvertHijriToGregorian(int HijriYear, int HijriMonth, int HijriDay, ref int yg, ref int mg, ref int dg)
847  {
848  int num = HijriDay - 1;
849  int num2 = HijriYear - 1318;
850  DateTime gregorianDate = HijriYearInfo[num2].GregorianDate;
851  int num3 = HijriYearInfo[num2].HijriMonthsLengthFlags;
852  for (int i = 1; i < HijriMonth; i++)
853  {
854  num += 29 + (num3 & 1);
855  num3 >>= 1;
856  }
857  gregorianDate = gregorianDate.AddDays(num);
858  yg = gregorianDate.Year;
859  mg = gregorianDate.Month;
860  dg = gregorianDate.Day;
861  }
862 
863  private static long GetAbsoluteDateUmAlQura(int year, int month, int day)
864  {
865  int yg = 0;
866  int mg = 0;
867  int dg = 0;
868  ConvertHijriToGregorian(year, month, day, ref yg, ref mg, ref dg);
869  return GregorianCalendar.GetAbsoluteDate(yg, mg, dg);
870  }
871 
872  internal static void CheckTicksRange(long ticks)
873  {
874  if (ticks < minDate.Ticks || ticks > maxDate.Ticks)
875  {
876  throw new ArgumentOutOfRangeException("time", string.Format(CultureInfo.InvariantCulture, Environment.GetResourceString("ArgumentOutOfRange_CalendarRange"), minDate, maxDate));
877  }
878  }
879 
880  internal static void CheckEraRange(int era)
881  {
882  if (era != 0 && era != 1)
883  {
884  throw new ArgumentOutOfRangeException("era", Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"));
885  }
886  }
887 
888  internal static void CheckYearRange(int year, int era)
889  {
890  CheckEraRange(era);
891  if (year < 1318 || year > 1500)
892  {
893  throw new ArgumentOutOfRangeException("year", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1318, 1500));
894  }
895  }
896 
897  internal static void CheckYearMonthRange(int year, int month, int era)
898  {
899  CheckYearRange(year, era);
900  if (month < 1 || month > 12)
901  {
902  throw new ArgumentOutOfRangeException("month", Environment.GetResourceString("ArgumentOutOfRange_Month"));
903  }
904  }
905 
906  private static void ConvertGregorianToHijri(DateTime time, ref int HijriYear, ref int HijriMonth, ref int HijriDay)
907  {
908  int num = 0;
909  int num2 = 0;
910  int num3 = 0;
911  int num4 = (int)((time.Ticks - minDate.Ticks) / 864000000000L) / 355;
912  while (time.CompareTo(HijriYearInfo[++num4].GregorianDate) > 0)
913  {
914  }
915  if (time.CompareTo(HijriYearInfo[num4].GregorianDate) != 0)
916  {
917  num4--;
918  }
919  TimeSpan timeSpan = time.Subtract(HijriYearInfo[num4].GregorianDate);
920  num = num4 + 1318;
921  num2 = 1;
922  num3 = 1;
923  double num5 = timeSpan.TotalDays;
924  int num6 = HijriYearInfo[num4].HijriMonthsLengthFlags;
925  int num7 = 29 + (num6 & 1);
926  while (num5 >= (double)num7)
927  {
928  num5 -= (double)num7;
929  num6 >>= 1;
930  num7 = 29 + (num6 & 1);
931  num2++;
932  }
933  num3 = (HijriDay = num3 + (int)num5);
934  HijriMonth = num2;
935  HijriYear = num;
936  }
937 
938  internal virtual int GetDatePart(DateTime time, int part)
939  {
940  int HijriYear = 0;
941  int HijriMonth = 0;
942  int HijriDay = 0;
943  long ticks = time.Ticks;
944  CheckTicksRange(ticks);
945  ConvertGregorianToHijri(time, ref HijriYear, ref HijriMonth, ref HijriDay);
946  switch (part)
947  {
948  case 0:
949  return HijriYear;
950  case 2:
951  return HijriMonth;
952  case 3:
953  return HijriDay;
954  case 1:
955  return (int)(GetAbsoluteDateUmAlQura(HijriYear, HijriMonth, HijriDay) - GetAbsoluteDateUmAlQura(HijriYear, 1, 1) + 1);
956  default:
957  throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_DateTimeParsing"));
958  }
959  }
960 
969  public override DateTime AddMonths(DateTime time, int months)
970  {
971  if (months < -120000 || months > 120000)
972  {
973  throw new ArgumentOutOfRangeException("months", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), -120000, 120000));
974  }
975  int datePart = GetDatePart(time, 0);
976  int datePart2 = GetDatePart(time, 2);
977  int num = GetDatePart(time, 3);
978  int num2 = datePart2 - 1 + months;
979  if (num2 >= 0)
980  {
981  datePart2 = num2 % 12 + 1;
982  datePart += num2 / 12;
983  }
984  else
985  {
986  datePart2 = 12 + (num2 + 1) % 12;
987  datePart += (num2 - 11) / 12;
988  }
989  if (num > 29)
990  {
991  int daysInMonth = GetDaysInMonth(datePart, datePart2);
992  if (num > daysInMonth)
993  {
994  num = daysInMonth;
995  }
996  }
997  CheckYearRange(datePart, 1);
998  DateTime result = new DateTime(GetAbsoluteDateUmAlQura(datePart, datePart2, num) * 864000000000L + time.Ticks % 864000000000L);
999  Calendar.CheckAddResult(result.Ticks, MinSupportedDateTime, MaxSupportedDateTime);
1000  return result;
1001  }
1002 
1011  public override DateTime AddYears(DateTime time, int years)
1012  {
1013  return AddMonths(time, years * 12);
1014  }
1015 
1021  public override int GetDayOfMonth(DateTime time)
1022  {
1023  return GetDatePart(time, 3);
1024  }
1025 
1031  public override DayOfWeek GetDayOfWeek(DateTime time)
1032  {
1033  return (DayOfWeek)((int)(time.Ticks / 864000000000L + 1) % 7);
1034  }
1035 
1041  public override int GetDayOfYear(DateTime time)
1042  {
1043  return GetDatePart(time, 1);
1044  }
1045 
1053  public override int GetDaysInMonth(int year, int month, int era)
1054  {
1055  CheckYearMonthRange(year, month, era);
1056  if ((HijriYearInfo[year - 1318].HijriMonthsLengthFlags & (1 << month - 1)) == 0)
1057  {
1058  return 29;
1059  }
1060  return 30;
1061  }
1062 
1063  internal static int RealGetDaysInYear(int year)
1064  {
1065  int num = 0;
1066  int num2 = HijriYearInfo[year - 1318].HijriMonthsLengthFlags;
1067  for (int i = 1; i <= 12; i++)
1068  {
1069  num += 29 + (num2 & 1);
1070  num2 >>= 1;
1071  }
1072  return num;
1073  }
1074 
1081  public override int GetDaysInYear(int year, int era)
1082  {
1083  CheckYearRange(year, era);
1084  return RealGetDaysInYear(year);
1085  }
1086 
1092  public override int GetEra(DateTime time)
1093  {
1094  CheckTicksRange(time.Ticks);
1095  return 1;
1096  }
1097 
1103  public override int GetMonth(DateTime time)
1104  {
1105  return GetDatePart(time, 2);
1106  }
1107 
1116  public override int GetMonthsInYear(int year, int era)
1117  {
1118  CheckYearRange(year, era);
1119  return 12;
1120  }
1121 
1127  public override int GetYear(DateTime time)
1128  {
1129  return GetDatePart(time, 0);
1130  }
1131 
1141  public override bool IsLeapDay(int year, int month, int day, int era)
1142  {
1143  if (day >= 1 && day <= 29)
1144  {
1145  CheckYearMonthRange(year, month, era);
1146  return false;
1147  }
1148  int daysInMonth = GetDaysInMonth(year, month, era);
1149  if (day < 1 || day > daysInMonth)
1150  {
1151  throw new ArgumentOutOfRangeException("day", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Day"), daysInMonth, month));
1152  }
1153  return false;
1154  }
1155 
1163  public override int GetLeapMonth(int year, int era)
1164  {
1165  CheckYearRange(year, era);
1166  return 0;
1167  }
1168 
1176  public override bool IsLeapMonth(int year, int month, int era)
1177  {
1178  CheckYearMonthRange(year, month, era);
1179  return false;
1180  }
1181 
1189  public override bool IsLeapYear(int year, int era)
1190  {
1191  CheckYearRange(year, era);
1192  if (RealGetDaysInYear(year) == 355)
1193  {
1194  return true;
1195  }
1196  return false;
1197  }
1198 
1215  public override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era)
1216  {
1217  if (day >= 1 && day <= 29)
1218  {
1219  CheckYearMonthRange(year, month, era);
1220  }
1221  else
1222  {
1223  int daysInMonth = GetDaysInMonth(year, month, era);
1224  if (day < 1 || day > daysInMonth)
1225  {
1226  throw new ArgumentOutOfRangeException("day", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Day"), daysInMonth, month));
1227  }
1228  }
1229  long absoluteDateUmAlQura = GetAbsoluteDateUmAlQura(year, month, day);
1230  if (absoluteDateUmAlQura >= 0)
1231  {
1232  return new DateTime(absoluteDateUmAlQura * 864000000000L + Calendar.TimeToTicks(hour, minute, second, millisecond));
1233  }
1234  throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_BadYearMonthDay"));
1235  }
1236 
1242  public override int ToFourDigitYear(int year)
1243  {
1244  if (year < 0)
1245  {
1246  throw new ArgumentOutOfRangeException("year", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
1247  }
1248  if (year < 100)
1249  {
1250  return base.ToFourDigitYear(year);
1251  }
1252  if (year < 1318 || year > 1500)
1253  {
1254  throw new ArgumentOutOfRangeException("year", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), 1318, 1500));
1255  }
1256  return year;
1257  }
1258  }
1259 }
override int GetMonth(DateTime time)
Calculates the month in which a specified date occurs.
override bool IsLeapDay(int year, int month, int day, int era)
Determines whether the specified date is a leap day.
Represents time in divisions, such as weeks, months, and years.
Definition: Calendar.cs:11
override int GetEra(DateTime time)
Calculates the era in which a specified date occurs.
override bool IsLeapMonth(int year, int month, int era)
Determines whether the specified month in the specified year and era is a leap month.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
Represents an instant in time, typically expressed as a date and time of day. To browse the ....
Definition: DateTime.cs:13
override bool IsLeapYear(int year, int era)
Determines whether the specified year in the specified era is a leap year.
override DateTime AddMonths(DateTime time, int months)
Calculates a date that is a specified number of months away from a specified initial date.
override int GetMonthsInYear(int year, int era)
Calculates the number of months in the specified year of the specified era.
A type representing a date and time value.
override int GetDaysInMonth(int year, int month, int era)
Calculates the number of days in the specified month of the specified year and era.
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
const int UmAlQuraEra
Represents the current era. This field is constant.
override int [] Eras
Gets a list of the eras that are supported by the current T:System.Globalization.UmAlQuraCalendar.
override int GetDaysInYear(int year, int era)
Calculates the number of days in the specified year of the specified era.
Represents the Saudi Hijri (Um Al Qura) calendar.
override int GetDayOfMonth(DateTime time)
Calculates the day of the month on which a specified date occurs.
override int ToFourDigitYear(int year)
Converts the specified year to a four-digit year by using the P:System.Globalization....
Format character that affects the layout of text or the operation of text processes,...
override DateTime AddYears(DateTime time, int years)
Calculates a date that is a specified number of years away from a specified initial date.
override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era)
Returns a T:System.DateTime that is set to the specified date, time, and era.
override CalendarAlgorithmType AlgorithmType
Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of...
override int GetLeapMonth(int year, int era)
Calculates the leap month for a specified year and era.
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
Definition: CultureInfo.cs:120
override int DaysInYearBeforeMinSupportedYear
Gets the number of days in the year that precedes the year that is specified by the P:System....
CalendarAlgorithmType
Specifies whether a calendar is solar-based, lunar-based, or lunisolar-based.
Specifies that the class can be serialized.
override DateTime MinSupportedDateTime
Gets the earliest date and time supported by this calendar.
override DateTime MaxSupportedDateTime
Gets the latest date and time supported by this calendar.
override DayOfWeek GetDayOfWeek(DateTime time)
Calculates the day of the week on which a specified date occurs.
override int GetDayOfYear(DateTime time)
Calculates the day of the year on which a specified date occurs.
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
override int TwoDigitYearMax
Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.
DayOfWeek
Specifies the day of the week.
Definition: DayOfWeek.cs:9
override int GetYear(DateTime time)
Calculates the year of a date represented by a specified T:System.DateTime.
long Ticks
Gets the number of ticks that represent the date and time of this instance.
Definition: DateTime.cs:315