本文整理汇总了VB.NET中System.Globalization.DateTimeFormatInfo.GetEra方法的典型用法代码示例。如果您正苦于以下问题:VB.NET DateTimeFormatInfo.GetEra方法的具体用法?VB.NET DateTimeFormatInfo.GetEra怎么用?VB.NET DateTimeFormatInfo.GetEra使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Globalization.DateTimeFormatInfo
的用法示例。
在下文中一共展示了DateTimeFormatInfo.GetEra方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: SamplesGregorianCalendar
' 导入命名空间
Imports System.Globalization
Public Class SamplesGregorianCalendar
Public Shared Sub Main()
' Creates strings with punctuation and without.
Dim strADPunc As [String] = "A.D."
Dim strADNoPunc As [String] = "AD"
Dim strCEPunc As [String] = "C.E."
Dim strCENoPunc As [String] = "CE"
' Calls DTFI.GetEra for each culture that uses GregorianCalendar as the default calendar.
Console.WriteLine(" ----- AD ----- ----- CE -----")
Console.WriteLine("CULTURE PUNC NO PUNC PUNC NO PUNC CALENDAR")
Dim myCI As CultureInfo
For Each myCI In CultureInfo.GetCultures(CultureTypes.SpecificCultures)
Console.Write("{0,-12}", myCI)
Console.Write("{0,-7}{1,-9}", myCI.DateTimeFormat.GetEra(strADPunc), myCI.DateTimeFormat.GetEra(strADNoPunc))
Console.Write("{0,-7}{1,-9}", myCI.DateTimeFormat.GetEra(strCEPunc), myCI.DateTimeFormat.GetEra(strCENoPunc))
Console.Write("{0}", myCI.Calendar)
Console.WriteLine()
Next myCI
End Sub
End Class
'This code produces the following output. This output has been cropped for brevity.
'
' ----- AD ----- ----- CE -----
'CULTURE PUNC NO PUNC PUNC NO PUNC CALENDAR
'ar-SA -1 -1 -1 -1 System.Globalization.HijriCalendar
'ar-IQ 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-EG 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-LY 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-DZ 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-MA 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-TN 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-OM 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-YE 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-SY 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-JO 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-LB 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-KW 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-AE 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-BH 1 1 -1 -1 System.Globalization.GregorianCalendar
'ar-QA 1 1 -1 -1 System.Globalization.GregorianCalendar
'bg-BG 1 1 -1 -1 System.Globalization.GregorianCalendar
'ca-ES -1 -1 -1 -1 System.Globalization.GregorianCalendar
'zh-TW -1 -1 -1 -1 System.Globalization.GregorianCalendar
'zh-CN -1 -1 -1 -1 System.Globalization.GregorianCalendar
'zh-HK -1 -1 -1 -1 System.Globalization.GregorianCalendar
'zh-SG 1 1 -1 -1 System.Globalization.GregorianCalendar
'zh-MO 1 1 -1 -1 System.Globalization.GregorianCalendar
'cs-CZ -1 -1 -1 -1 System.Globalization.GregorianCalendar
'da-DK 1 1 -1 -1 System.Globalization.GregorianCalendar