<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public Class TaiwanCalendar Inherits Calendar
Dim instance As TaiwanCalendar
[SerializableAttribute] [ComVisibleAttribute(true)] public class TaiwanCalendar : Calendar
[SerializableAttribute] [ComVisibleAttribute(true)] public ref class TaiwanCalendar : public Calendar
/** @attribute SerializableAttribute() */ /** @attribute ComVisibleAttribute(true) */ public class TaiwanCalendar extends Calendar
SerializableAttribute ComVisibleAttribute(true) public class TaiwanCalendar extends Calendar
台灣曆法運作方式與西曆完全一樣,只是年份和紀元不同。TaiwanCalendar 類別只識別目前的紀元。
台灣曆法中的閏年與西曆中的閏年相符。在西曆中,閏年被定義為能被 4 整除而不被 100 整除的年份,但是能被 400 整除。平年有 365 天,而閏年有 366 天。
台灣使用的曆法有 12 月份,各有 28 至 31 天:
GetMonth 值
月份
平年的天數
閏年的天數
1
1 月 (一月)
31
2
2 月 (二月)
28
29
3
3 月 (三月)
4
4 月 (四月)
30
5
5 月 (五月)
6
6 月 (六月)
7
7 月 (七月)
8
8 月 (八月)
9
9 月 (九月)
10
10 月 (十月)
11
11 月 (十一月)
12
12 月 (十二月)
在閏年,二月份有 29 天,而在平年則有 28 天。
西曆中的日期 C.E. 紀元 2001 年一月 1 日等於台灣使用的曆法目前紀元的 90 年一月的第一天。
每一 CultureInfo 都支援一套曆法。Calendar 屬性傳回預設文化特性 (Culture) 的曆法,而 OptionalCalendars 屬性則傳回陣列,其包含文化特性所支援的所有曆法。若要變更 CultureInfo 所使用的曆法,請將 CultureInfo.DateTimeFormat 的 Calendar 屬性設定為新的 Calendar。
如果 DateTimeFormatInfo.Calendar 為 TaiwanCalendar,但是 Thread.CurrentCulture 並非 "zh-TW",DateTimeFormatInfo.NativeCalendarName、DateTimeFormatInfo.GetEraName 和 DateTimeFormatInfo.GetAbbreviatedEraName 傳回空字串 ("")。
Windows 98、 Windows 2000 SP4、 Windows CE、 Windows Millennium Edition、 Windows Mobile for Pocket PC、 Windows Mobile for Smartphone、 Windows Server 2003、 Windows XP Media Center Edition、 Windows XP Professional x64 Edition、 Windows XP SP2、 Windows XP Starter Edition
.NET Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱系統需求一節的內容。