แก้ไข

แชร์ผ่าน


ISOWeek.GetWeekOfYear Method

Definition

Overloads

GetWeekOfYear(DateOnly)
GetWeekOfYear(DateTime)

Calculates the ISO week number of a given Gregorian date.

GetWeekOfYear(DateOnly)

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

Parameters

date
DateOnly

Returns

Applies to

GetWeekOfYear(DateTime)

Source:
ISOWeek.cs
Source:
ISOWeek.cs
Source:
ISOWeek.cs

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