GregorianCalendar.GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek) GregorianCalendar.GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek) GregorianCalendar.GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek) GregorianCalendar.GetWeekOfYear(DateTime, CalendarWeekRule, DayOfWeek) Method

Definición

Devuelve la semana del año que incluye la fecha en la instancia especificada DateTime objeto.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);
override this.GetWeekOfYear : DateTime * System.Globalization.CalendarWeekRule * DayOfWeek -> int
Public Overrides Function GetWeekOfYear (time As DateTime, rule As CalendarWeekRule, firstDayOfWeek As DayOfWeek) As Integer

Parámetros

time
DateTime DateTime DateTime DateTime

La DateTime objeto va a leer.The DateTime object to read.

rule
CalendarWeekRule CalendarWeekRule CalendarWeekRule CalendarWeekRule

Uno de los CalendarWeekRule valores que define una semana del calendario.One of the CalendarWeekRule values that defines a calendar week.

firstDayOfWeek
DayOfWeek DayOfWeek DayOfWeek DayOfWeek

Uno de los DayOfWeek valores que representa el primer día de la semana.One of the DayOfWeek values that represents the first day of the week.

Devoluciones

Un entero basado en 1 que representa la semana del año que incluye la fecha en la time parámetro.A 1-based integer that represents the week of the year that includes the date in the time parameter.

Excepciones

firstDayOfWeek está fuera del intervalo admitido por el calendario.firstDayOfWeek is outside the range supported by the calendar.

-o bien--or- rule no es un valor CalendarWeekRule válido.rule is not a valid CalendarWeekRule value.

Se aplica a