HebrewCalendar クラス

定義

ヘブライ暦を表します。

public ref class HebrewCalendar : System::Globalization::Calendar
public class HebrewCalendar : System.Globalization.Calendar
[System.Serializable]
public class HebrewCalendar : System.Globalization.Calendar
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class HebrewCalendar : System.Globalization.Calendar
type HebrewCalendar = class
    inherit Calendar
[<System.Serializable>]
type HebrewCalendar = class
    inherit Calendar
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type HebrewCalendar = class
    inherit Calendar
Public Class HebrewCalendar
Inherits Calendar
継承
HebrewCalendar
属性

次の例では、クラスでサポートされている日付範囲を含むファイルを HebrewCalendar 作成し、5772 年の各月の日数を表示します。

using System;
using System.Globalization;
using System.IO;
using System.Threading;

public class Example
{
   public static void Main()
   {
      StreamWriter output = new StreamWriter("HebrewCalendarInfo.txt");

      // Make the Hebrew Calendar the current calendar and
      // Hebrew (Israel) the current thread culture.
      HebrewCalendar hc = new HebrewCalendar();
      CultureInfo culture = CultureInfo.CreateSpecificCulture("he-IL");
      culture.DateTimeFormat.Calendar = hc;
      Thread.CurrentThread.CurrentCulture = culture;

      output.WriteLine("{0} Information:\n",
                       GetCalendarName(culture.DateTimeFormat.Calendar));

      // Get the calendar range expressed in both Hebrew calendar and
      // Gregorian calendar dates.
      output.WriteLine("Start Date: {0} ", hc.MinSupportedDateTime);
      culture.DateTimeFormat.Calendar = culture.Calendar;
      output.WriteLine("            ({0} Gregorian)\n",
                       hc.MinSupportedDateTime);

      culture.DateTimeFormat.Calendar = hc;
      output.WriteLine("End Date: {0} ", hc.MaxSupportedDateTime);
      culture.DateTimeFormat.Calendar = culture.Calendar;
      output.WriteLine("          ({0} Gregorian)\n",
                       hc.MaxSupportedDateTime);

      culture.DateTimeFormat.Calendar = hc;

      // Get the year in the Hebrew calendar that corresponds to 1/1/2012
      // and display information about it.
      DateTime startOfYear = new DateTime(2012, 1, 1);
      output.WriteLine("Days in the Year {0}: {1}\n",
                       hc.GetYear(startOfYear),
                       hc.GetDaysInYear(hc.GetYear(startOfYear)));

      output.WriteLine("Days in Each Month of {0}:\n", hc.GetYear(startOfYear));
      output.WriteLine("Month       Days       Month Name");
      // Change start of year to first day of first month
      startOfYear = hc.ToDateTime(hc.GetYear(startOfYear), 1, 1, 0, 0, 0, 0);
      DateTime startOfMonth = startOfYear;
      for (int ctr = 1; ctr <= hc.GetMonthsInYear(hc.GetYear(startOfYear)); ctr++) {
         output.Write(" {0,2}", ctr);
         output.WriteLine("{0,12}{1,15:MMM}",
                          hc.GetDaysInMonth(hc.GetYear(startOfMonth), hc.GetMonth(startOfMonth)),
                          startOfMonth);
         startOfMonth = hc.AddMonths(startOfMonth, 1);
      }

      output.Close();
   }

   private static string GetCalendarName(Calendar cal)
   {
      return cal.ToString().Replace("System.Globalization.", "").Replace("Cal", " Cal");
   }
}
// The example displays the following output:
//       Hebrew Calendar Information:
//
//       Start Date: ז// טבת שמ"ג 00:00:00
//                   (01/01/1583 00:00:00 Gregorian)
//
//       End Date: כ"ט אלול תתקצ"ט 23:59:59
//                 (29/09/2239 23:59:59 Gregorian)
//
//       Days in the Year 5772: 354
//
//       Days in Each Month of 5772:
//
//       Month       Days       Month Name
//         1          30           תשרי
//         2          29           חשון
//         3          30           כסלו
//         4          29            טבת
//         5          30            שבט
//         6          29            אדר
//         7          30           ניסן
//         8          29           אייר
//         9          30           סיון
//        10          29           תמוז
//        11          30             אב
//        12          29           אלול
Imports System.Globalization
Imports System.IO
Imports System.Threading

Module Example
   Public Sub Main()
      Dim output As New StreamWriter("HebrewCalendarInfo.txt")
      
      ' Make the Hebrew Calendar the current calendar and
      ' Hebrew (Israel) the current thread culture.
      Dim hc As New HebrewCalendar()
      Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture("he-IL")
      culture.DateTimeFormat.Calendar = hc
      Thread.CurrentThread.CurrentCulture = culture
      
      output.WriteLine("{0} Information:", 
                       GetCalendarName(culture.DateTimeFormat.Calendar))
      output.WriteLine()
      
      ' Get the calendar range expressed in both Hebrew calendar and
      ' Gregorian calendar dates.
      output.WriteLine("Start Date: {0} ", 
                       hc.MinSupportedDateTime)  
      culture.DateTimeFormat.Calendar = culture.Calendar
      output.WriteLine("            ({0} Gregorian)", 
                       hc.MinSupportedDateTime)
      output.WriteLine()
      
      culture.DateTimeFormat.Calendar = hc
      output.WriteLine("End Date: {0} ", 
                   hc.MaxSupportedDateTime)
      culture.DateTimeFormat.Calendar = culture.Calendar
      output.WriteLine("          ({0} Gregorian)", 
                       hc.MaxSupportedDateTime)  
      output.WriteLine()
      
      culture.DateTimeFormat.Calendar = hc
      
      ' Get the year in the Hebrew calendar that corresponds to 1/1/2012
      ' and display information about it.
      Dim startOfYear As Date = #1/1/2012#
      output.WriteLine("Days in the Year {0}: {1}", 
                       hc.GetYear(startOfYear), 
                       hc.GetDaysInYear(hc.GetYear(startOfYear)))
      output.WriteLine()
      
      output.WriteLine("Days in Each Month of {0}:", hc.GetYear(startOfYear))
      output.WriteLine()
      output.WriteLine("Month       Days       Month Name")
      ' Change start of year to first day of first month 
      startOfYear = hc.ToDateTime(hc.GetYear(startOfYear), 1, 1, 0, 0, 0, 0)
      Dim startOfMonth As Date = startOfYear
      For ctr As Integer = 1 To hc.GetMonthsInYear(hc.GetYear(startOfYear)) 
         output.Write(" {0,2}", ctr)
         output.WriteLine("{0,12}{1,15:MMM}", 
                          hc.GetDaysInMonth(hc.GetYear(startOfMonth), hc.GetMonth(startOfMonth)),
                          startOfMonth)  
         startOfMonth = hc.AddMonths(startOfMonth, 1)                 
      Next 
                                     
      output.Close()          
   End Sub
   
   Private Function GetCalendarName(cal As Calendar) As String
      Return cal.ToString().Replace("System.Globalization.", "").Replace("Cal", " Cal")
   End Function
End Module
' The example displays the following output:
'       Hebrew Calendar Information:
'       
'       Start Date: ז' טבת שמ"ג 00:00:00 
'                   (01/01/1583 00:00:00 Gregorian)
'       
'       End Date: כ"ט אלול תתקצ"ט 23:59:59 
'                 (29/09/2239 23:59:59 Gregorian)
'       
'       Days in the Year 5772: 354
'       
'       Days in Each Month of 5772:
'       
'       Month       Days       Month Name
'         1          30           תשרי
'         2          29           חשון
'         3          30           כסלו
'         4          29            טבת
'         5          30            שבט
'         6          29            אדר
'         7          30           ניסן
'         8          29           אייר
'         9          30           סיון
'        10          29           תמוז
'        11          30             אב
'        12          29           אלול

この例では、オブジェクトを HebrewCalendar インスタンス化し、ヘブライ語 (イスラエル) CultureInfo オブジェクトの現在のカレンダーにします。 その後、ヘブライ語 (イスラエル) が現在の文化になります。 これにより、共通言語ランタイムはヘブライ語のカレンダーに関連するすべての日付と時刻を解釈します。

注釈

ヘブライ語のカレンダーは、B.C.E. の 2 つの時代 (年号) を認識します。 (一般的な時代以前) と午前 0 時 (ラテン語 "Anno Mundi", これは"世界の年"を意味します). このクラスの実装では、現在の HebrewCalendar 時代 (午前) とヘブライ暦 5343 年から 5999 年 (グレゴリオ暦では 1583 年から 2239 年) のみを認識します。

注意

HebrewCalendar クラスや .NET Framework のその他のカレンダー クラスの使用方法の詳細については、「カレンダーの使用」を参照してください。

19 年ごとに、19 年で均等に割り切れる年で終わるサイクルでは、3、6、8、11、14、17、19 年は閏年です。 一般的な年は、ユダヤ人の祝日の配置に応じて、353 から 355 日を持つことができます。 閏年は、383 日から 385 日までです。

ヘブライ語のカレンダーには、一般的な年の間に 12 か月、閏年の間に 13 か月があります。

GetMonth 値 (一般的な年) GetMonth 値 (うるう年) Month 平年の日数 閏年の日数
1 1 תשרי (Tishrei) 30 30
2 2 חשון (Cheshvan) 29/30 29/30
3 3 㪗סלו (Kislev) 29/30 29/30
4 4 טבת (Tevet) 29 29
5 5 שבט (Shevat) 30 30
6 - אדר (Adar) 29 -
- 6 אדר א (Adar Alef) - 30
- 7 אדר ב (Adar Beit) - 29
7 8 ניסן (日産) 30 30
8 9 אייר (Iyar) 29 29
9 10 סיון (Sivan) 30 30
10 11 תמוז (Tamuz) 29 29
11 12 אב (Av) 30 30
12 13 אלול (Elul) 29 29

シェシュヴァンとキスレフの日は、ユダヤ人の休日の配置によって異なります。 閏年の間に、Adar は Adar Alef に 30 日、アダル ベイトは 29 日に置き換えられます。 Adar Alef は閏月と見なされます。 アダル・アリーフの最後の日とアダル・ベイトのすべての日は閏の日と見なされます。つまり、これらの日の IsLeapDay メソッドは返されます true

グレゴリオ暦の西暦 2001 年 グレゴリオ暦では、午前 5761 年のテヴェトの 6 日目に相当します。 ヘブライ語のカレンダーに表示されます。

それぞれ CultureInfo 、一連の予定表がサポートされています。 Calendar プロパティは、カルチャの既定のカレンダーを返し、OptionalCalendars プロパティは、カルチャでサポートされているすべてのカレンダーを含む配列を返します。 CultureInfo が使用するカレンダーを変更するには、アプリケーションで CalendarCultureInfo.DateTimeFormat プロパティに新しい Calendar を設定してください。

コンストラクター

HebrewCalendar()

HebrewCalendar クラスの新しいインスタンスを初期化します。

フィールド

CurrentEra

現在のカレンダーの現在の時代 (年号) を表します。 このフィールドの値は 0 です。

(継承元 Calendar)
HebrewEra

現在の時代 (年号) を表します。 このフィールドは定数です。

プロパティ

AlgorithmType

現在のカレンダーの暦法 (太陽暦、太陰暦、または両者の組み合わせ) を示す値を取得します。

AlgorithmType

現在のカレンダーの暦法 (太陽暦、太陰暦、または両者の組み合わせ) を示す値を取得します。

(継承元 Calendar)
DaysInYearBeforeMinSupportedYear

MinSupportedDateTime プロパティで指定された年の前の年の日数を取得します。

(継承元 Calendar)
Eras

HebrewCalendar における時代 (年号) のリストを取得します。

IsReadOnly

この Calendar オブジェクトが読み取り専用かどうかを示す値を取得します。

(継承元 Calendar)
MaxSupportedDateTime

HebrewCalendar 型でサポートされている最も新しい日付と時刻を取得します。

MaxSupportedDateTime

この Calendar オブジェクトでサポートされている最も新しい日付と時刻を取得します。

(継承元 Calendar)
MinSupportedDateTime

HebrewCalendar 型でサポートされている最も古い日付と時刻を取得します。

MinSupportedDateTime

この Calendar オブジェクトでサポートされている最も古い日付と時刻を取得します。

(継承元 Calendar)
TwoDigitYearMax

年の 2 桁表記で表すことができる 100 年間の範囲内で最後に当たる年を取得または設定します。

メソッド

AddDays(DateTime, Int32)

指定した DateTime から指定した日数が経過した後の DateTime を返します。

(継承元 Calendar)
AddHours(DateTime, Int32)

指定した DateTime から指定した時間数が経過した後の DateTime を返します。

(継承元 Calendar)
AddMilliseconds(DateTime, Double)

指定した DateTime から指定したミリ秒数が経過した後の DateTime を返します。

(継承元 Calendar)
AddMinutes(DateTime, Int32)

指定した DateTime から指定した分数が経過した後の DateTime を返します。

(継承元 Calendar)
AddMonths(DateTime, Int32)

指定した DateTime から指定した月数が経過した後の DateTime を返します。

AddSeconds(DateTime, Int32)

指定した DateTime から指定した秒数が経過した後の DateTime を返します。

(継承元 Calendar)
AddWeeks(DateTime, Int32)

指定した DateTime から指定した週数が経過した後の DateTime を返します。

(継承元 Calendar)
AddYears(DateTime, Int32)

指定した DateTime から指定した年数が経過した後の DateTime を返します。

Clone()

現在の Calendar オブジェクトのコピーである新しいオブジェクトを作成します。

(継承元 Calendar)
Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetDayOfMonth(DateTime)

指定した DateTime の日付を返します。

GetDayOfWeek(DateTime)

指定した DateTime の曜日を返します。

GetDayOfYear(DateTime)

指定した DateTime の年間積算日を返します。

GetDaysInMonth(Int32, Int32)

現在の時代 (年号) の指定した月および年の日数を返します。

(継承元 Calendar)
GetDaysInMonth(Int32, Int32, Int32)

指定した時代 (年号) の指定した年の指定した月の日数を返します。

GetDaysInYear(Int32)

現在の時代 (年号) の指定した年の日数を返します。

(継承元 Calendar)
GetDaysInYear(Int32, Int32)

指定した時代 (年号) の指定した年の日数を返します。

GetEra(DateTime)

指定した DateTime の時代 (年号) を返します。

GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetHour(DateTime)

指定した DateTime の時間の値を返します。

(継承元 Calendar)
GetLeapMonth(Int32)

指定された年の閏月を計算します。

(継承元 Calendar)
GetLeapMonth(Int32, Int32)

指定された年と時代 (年号) の閏月を計算します。

GetLeapMonth(Int32, Int32)

指定された年と時代 (年号) の閏月を計算します。

(継承元 Calendar)
GetMilliseconds(DateTime)

指定した DateTime のミリ秒の値を返します。

(継承元 Calendar)
GetMinute(DateTime)

指定した DateTime の分の値を返します。

(継承元 Calendar)
GetMonth(DateTime)

指定した DateTime の月を返します。

GetMonthsInYear(Int32)

現在の時代 (年号) の指定した年の月数を返します。

(継承元 Calendar)
GetMonthsInYear(Int32, Int32)

指定した時代 (年号) の指定した年の月数を返します。

GetSecond(DateTime)

指定した DateTime の秒の値を返します。

(継承元 Calendar)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek)

指定した DateTime 値の日付を含む年の週を返します。

(継承元 Calendar)
GetYear(DateTime)

指定した DateTime 値の年を返します。

IsLeapDay(Int32, Int32, Int32)

現在の時代 (年号) の指定した日付が閏日かどうかを判断します。

(継承元 Calendar)
IsLeapDay(Int32, Int32, Int32, Int32)

指定した時代 (年号) の指定した日付が閏日かどうかを確認します。

IsLeapMonth(Int32, Int32)

現在の時代 (年号) の指定した年の指定した月が閏月かどうかを判断します。

(継承元 Calendar)
IsLeapMonth(Int32, Int32, Int32)

指定した時代 (年号) の指定した年の指定した月が閏月かどうかを確認します。

IsLeapYear(Int32)

現在の時代 (年号) の指定した年が閏年かどうかを判断します。

(継承元 Calendar)
IsLeapYear(Int32, Int32)

指定した時代 (年号) の指定した年が閏年かどうかを確認します。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32)

現在の時代 (年号) の指定した日付と時刻に設定された DateTime を返します。

(継承元 Calendar)
ToDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

指定した時代 (年号) の指定した日付と時刻に設定された DateTime を返します。

ToFourDigitYear(Int32)

TwoDigitYearMax プロパティを使用して、指定した年を 4 桁表記に変換し、適切な世紀を判断します。

ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください