本文整理匯總了VB.NET中System.Globalization.HijriCalendar.HijriAdjustment屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET HijriCalendar.HijriAdjustment屬性的具體用法?VB.NET HijriCalendar.HijriAdjustment怎麽用?VB.NET HijriCalendar.HijriAdjustment使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。
在下文中一共展示了HijriCalendar.HijriAdjustment屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: SamplesHijriCalendar
' 導入命名空間
Imports System.Globalization
Public Class SamplesHijriCalendar
Public Shared Sub Main()
' Creates and initializes a HijriCalendar.
Dim myCal As New HijriCalendar()
' Creates a DateTime and initializes it to the second day of the first month of the year 1422.
Dim myDT As New DateTime(1422, 1, 2, myCal)
' Displays the current values of the DateTime.
Console.WriteLine("HijriAdjustment is {0}.", myCal.HijriAdjustment)
Console.WriteLine(" Year is {0}.", myCal.GetYear(myDT))
Console.WriteLine(" Month is {0}.", myCal.GetMonth(myDT))
Console.WriteLine(" Day is {0}.", myCal.GetDayOfMonth(myDT))
' Sets the HijriAdjustment property to 2.
myCal.HijriAdjustment = 2
Console.WriteLine("HijriAdjustment is {0}.", myCal.HijriAdjustment)
Console.WriteLine(" Year is {0}.", myCal.GetYear(myDT))
Console.WriteLine(" Month is {0}.", myCal.GetMonth(myDT))
Console.WriteLine(" Day is {0}.", myCal.GetDayOfMonth(myDT))
' Sets the HijriAdjustment property to -2.
myCal.HijriAdjustment = - 2
Console.WriteLine("HijriAdjustment is {0}.", myCal.HijriAdjustment)
Console.WriteLine(" Year is {0}.", myCal.GetYear(myDT))
Console.WriteLine(" Month is {0}.", myCal.GetMonth(myDT))
Console.WriteLine(" Day is {0}.", myCal.GetDayOfMonth(myDT))
End Sub
End Class
'This code produces the following output. Results vary depending on the registry settings.
'
'HijriAdjustment is 0.
' Year is 1422.
' Month is 1.
' Day is 2.
'HijriAdjustment is 2.
' Year is 1422.
' Month is 1.
' Day is 4.
'HijriAdjustment is -2.
' Year is 1421.
' Month is 12.
' Day is 29.