Breyta

Deila með


ISOWeek.GetWeekOfYear(DateTime) Method

Definition

Calculates the ISO week number of a given Gregorian date.

public:
 static int GetWeekOfYear(DateTime date);
public static int GetWeekOfYear (DateTime date);
static member GetWeekOfYear : DateTime -> int
Public Shared Function GetWeekOfYear (date As DateTime) As Integer

Parameters

date
DateTime

A date in the Gregorian calendar.

Returns

A number between 1 and 53 representing the ISO week number of the given Gregorian date.

Remarks

The returned ISO week number can belong to an ISO year that is different from the input Gregorian year. For example, the Gregorian date 2005-01-01 will have ISO week number 53 but ISO year 2004.

To get the ISO week-numbering year (also called the ISO year informally), call GetYear(DateTime)

Applies to