'Declaration Public Overloads Shared Function DatePart( _ ByVal interval As String, _ ByVal dateValue As Object, _ Optional ByVal dayOfWeek As FirstDayOfWeek, _ Optional ByVal weekOfYear As FirstWeekOfYear _ ) As Integer
public static int DatePart( string interval, object dateValue, FirstDayOfWeek dayOfWeek, FirstWeekOfYear weekOfYear )
Parameters
- interval
- Required. DateInterval enumeration value or String expression representing the part of the date/time value you want to return.
- dateValue
- Required. Date value that you want to evaluate.
- dayOfWeek
- Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.Sunday is used.
- weekOfYear
- Optional. A value chosen from the FirstWeekOfYear enumeration that specifies the first week of the year. If not specified, FirstWeekOfYear.Jan1 is used.
Return Value
Returns an Integer value containing the specified component of a given Date value.