ActiveReports 12
DatePart(String,Object,FirstDayOfWeek,FirstWeekOfYear) Method

GrapeCity.ActiveReports.v12 Assembly > GrapeCity.Enterprise.Data.VisualBasicReplacement Namespace > DateAndTime Class > DatePart Method : DatePart(String,Object,FirstDayOfWeek,FirstWeekOfYear) Method
Required. DateInterval enumeration value or String expression representing the part of the date/time value you want to return.
Required. Date value that you want to evaluate.
Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.Sunday is used.
Optional. A value chosen from the FirstWeekOfYear enumeration that specifies the first week of the year. If not specified, FirstWeekOfYear.Jan1 is used.
Returns an Integer value containing the specified component of a given Date value.
Syntax
'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.
See Also

Reference

DateAndTime Class
DateAndTime Members
Overload List