GregorianCalendar.GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the week of the year that includes the date in the specified DateTime object.
public:
override int GetWeekOfYear(DateTime time, System::Globalization::CalendarWeekRule rule, DayOfWeek firstDayOfWeek);
[System.Runtime.InteropServices.ComVisible(false)]
public override int GetWeekOfYear (DateTime time, System.Globalization.CalendarWeekRule rule, DayOfWeek firstDayOfWeek);
[<System.Runtime.InteropServices.ComVisible(false)>]
override this.GetWeekOfYear : DateTime * System.Globalization.CalendarWeekRule * DayOfWeek -> int
Public Overrides Function GetWeekOfYear (time As DateTime, rule As CalendarWeekRule, firstDayOfWeek As DayOfWeek) As Integer
Parameters
- rule
- CalendarWeekRule
One of the CalendarWeekRule values that defines a calendar week.
Returns
A 1-based integer that represents the week of the year that includes the date in the time
parameter.
- Attributes
Exceptions
firstDayOfWeek
is outside the range supported by the calendar.
-or-
rule
is not a valid CalendarWeekRule value.
Applies to
Samarbeta med oss på GitHub
Källan för det här innehållet finns på GitHub, där du även kan skapa och granska ärenden och pull-begäranden. Se vår deltagarguide för mer information.