ActiveReports 12
DateSerial Method

GrapeCity.ActiveReports.v12 Assembly > GrapeCity.Enterprise.Data.VisualBasicReplacement Namespace > DateAndTime Class : DateSerial Method
Required. Integer expression from 1 through 9999. However, values below this range are also accepted. If year is 0 through 99, it is interpreted as being between 1930 and 2029, as explained in the "Remarks" section below. If year is less than 1, it is subtracted from the current year.
Required. Integer expression from 1 through 12. However, values outside this range are also accepted. The value of month is offset by 1 and applied to January of the calculated year. In other words, (month - 1) is added to January. The year is recalculated if necessary. The following results illustrate this effect: If month is 1, the result is January of the calculated year. If month is 0, the result is December of the previous year. If month is -1, the result is November of the previous year. If month is 13, the result is January of the following year.
Required. Integer expression from 1 through 31. However, values outside this range are also accepted. The value of day is offset by 1 and applied to the first day of the calculated month. In other words, (day - 1) is added to the first of the month. The month and year are recalculated if necessary. The following results illustrate this effect: If day is 1, the result is the first day of the calculated month. If day is 0, the result is the last day of the previous month. If day is -1, the result is the penultimate day of the previous month. If day is past the end of the current month, the result is the appropriate day of the following month. For example, if month is 4 and day is 31, the result is May 1.
Returns a Date value representing a specified year, month, and day, with the time information set to midnight (00:00:00).
Syntax
'Declaration
 
Public Shared Function DateSerial( _
   ByVal year As Integer, _
   ByVal month As Integer, _
   ByVal day As Integer _
) As Date
public static DateTime DateSerial( 
   int year,
   int month,
   int day
)

Parameters

year
Required. Integer expression from 1 through 9999. However, values below this range are also accepted. If year is 0 through 99, it is interpreted as being between 1930 and 2029, as explained in the "Remarks" section below. If year is less than 1, it is subtracted from the current year.
month
Required. Integer expression from 1 through 12. However, values outside this range are also accepted. The value of month is offset by 1 and applied to January of the calculated year. In other words, (month - 1) is added to January. The year is recalculated if necessary. The following results illustrate this effect: If month is 1, the result is January of the calculated year. If month is 0, the result is December of the previous year. If month is -1, the result is November of the previous year. If month is 13, the result is January of the following year.
day
Required. Integer expression from 1 through 31. However, values outside this range are also accepted. The value of day is offset by 1 and applied to the first day of the calculated month. In other words, (day - 1) is added to the first of the month. The month and year are recalculated if necessary. The following results illustrate this effect: If day is 1, the result is the first day of the calculated month. If day is 0, the result is the last day of the previous month. If day is -1, the result is the penultimate day of the previous month. If day is past the end of the current month, the result is the appropriate day of the following month. For example, if month is 4 and day is 31, the result is May 1.

Return Value

Returns a Date value representing a specified year, month, and day, with the time information set to midnight (00:00:00).
See Also

Reference

DateAndTime Class
DateAndTime Members