The Date type exposes the following members.

Constructors

  NameDescription
Public methodDate(DateTime)
Initializes a new instance of the Date structure.
Public methodDate(Int32, Int32, Int32)
Initializes a new instance of the Date structure to the specified year, month, and day.
Public methodDate(Int32, Int32, Int32, Calendar)
Initializes a new instance of the Date structure to the specified year, month, and day for the specified calendar.

Methods

  NameDescription
Public methodAdd
Adds the value of the specified TimeSpan to the value of this instance.
Public methodAddDays
Adds the specified number of days to the value of this instance.
Public methodAddHours
Adds the specified number of hours to the value of this instance.
Public methodAddMilliseconds
Adds the specified number of milliseconds to the value of this instance.
Public methodAddMinutes
Adds the specified number of minutes to the value of this instance.
Public methodAddMonths
Adds the specified number of months to the value of this instance.
Public methodAddSeconds
Adds the specified number of seconds to the value of this instance.
Public methodAddTicks
Adds the specified number of ticks to the value of this instance.
Public methodAddYears
Adds the specified number of years to the value of this instance.
Public methodStatic memberCompare
Compares two instances of Date and returns an indication of their relative values.
Public methodCompareTo(Object)
Compares the value of this instance to a specified object that contains a specified Date or DateTime value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified Date or DateTime value.
Public methodCompareTo(Date)
Compares the value of this instance to a specified Date value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified Date value.
Public methodStatic memberDaysInMonth
Returns the number of days in the specified month and year.
Public methodEquals(Object)
Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueType..::..Equals(Object).)
Public methodEquals(Date)
Returns a value indicating whether this instance is equal to the specified Date instance.
Public methodStatic memberEquals(Date, Date)
Returns a value indicating whether two instances of Date are equal.
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode
Returns the hash code for this instance.
(Overrides ValueType..::..GetHashCode()()()().)
Public methodGetType (Inherited from Object.)
Public methodStatic memberIsLeapYear
Returns an indication whether the specified year is a leap year.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodStatic memberParse(String)
Converts the specified string representation of a date to its Date equivalent.
Public methodStatic memberParse(String, IFormatProvider)
Converts the specified string representation of a date to its Date equivalent using the specified culture-specific format information.
Public methodStatic memberParse(String, IFormatProvider, DateTimeStyles)
Converts the specified string representation of a date to its Date equivalent using the specified culture-specific format information and formatting style.
Public methodStatic memberParseExact(String, String, IFormatProvider)
Converts the specified string representation of a date to its Date equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.
Public methodStatic memberParseExact(String, String, IFormatProvider, DateTimeStyles)
Converts the specified string representation of a date to its Date equivalent using the specified format, culture-specific format information, and formatting style. The format of the string representation must match the specified format exactly.
Public methodStatic memberParseExact(String, array<String>[]()[][], IFormatProvider, DateTimeStyles)
Converts the specified string representation of a date to its Date equivalent using the specified array of formats, culture-specific format information, and formatting style. The format of the string representation must match at least one of the specified formats exactly.
Public methodSubtract(DateTime)
Subtracts the specified date and time from this instance.
Public methodSubtract(TimeSpan)
Subtracts the specified duration from this instance.
Public methodToDateTime
Returns a date time value based on the current date value, having no time information.
Public methodToLongDateString
Converts the value of the current Date object to its equivalent long date string representation.
Public methodToShortDateString
Converts the value of the current Date object to its equivalent short date string representation.
Public methodToString()()()()
Converts the value of the current Date object to its equivalent string representation.
(Overrides ValueType..::..ToString()()()().)
Public methodToString(IFormatProvider)
Converts the value of the current Date object to its equivalent string representation using the specified culture-specific format information.
Public methodToString(String)
Converts the value of the current Date object to its equivalent string representation using the specified format.
Public methodToString(String, IFormatProvider)
Converts the value of the current Date object to its equivalent string representation using the specified format and culture-specific format information.
Public methodStatic memberTryParse(String, Date%)
Converts the specified string representation of a date to its Date equivalent.
Public methodStatic memberTryParse(String, IFormatProvider, DateTimeStyles, Date%)
Converts the specified string representation of a date to its Date equivalent using the specified culture-specific format information and formatting style.
Public methodStatic memberTryParseExact(String, String, IFormatProvider, DateTimeStyles, Date%)
Converts the specified string representation of a date to its Date equivalent using the specified format, culture-specific format information, and formatting style. The format of the string representation must match the specified format exactly.
Public methodStatic memberTryParseExact(String, array<String>[]()[][], IFormatProvider, DateTimeStyles, Date%)
Converts the specified string representation of a date to its Date equivalent using the specified array of formats, culture-specific format information, and formatting style. The format of the string representation must match at least one of the specified formats exactly.

Operators

  NameDescription
Public operatorStatic memberAddition
Adds a specified time interval to a specified date, yielding a new date and time.
Public operatorStatic memberEquality
Determines whether a specified instance of Date is equal to a specified DateTime.
Public operatorStatic memberGreaterThan
Determines whether one specified Date is greater than a specified DateTime.
Public operatorStatic memberGreaterThanOrEqual
Determines whether one specified Date is greater than or equal to a specified DateTime.
Public operatorStatic memberImplicitWideningImplicitImplicitImplicit(DateTime to Date)
Casts a date and time value to a date value.
Public operatorStatic memberImplicitWideningImplicitImplicitImplicit(Date to DateTime)
Casts a date value to a date and time value.
Public operatorStatic memberInequality
Determines whether a specified instance of Date is not equal to a specified DateTime.
Public operatorStatic memberLessThan
Determines whether one specified Date is less than a specified DateTime.
Public operatorStatic memberLessThanOrEqual
Determines whether one specified Date is less than or equal to a specified DateTime.
Public operatorStatic memberSubtraction(Date, DateTime)
Subtracts a specified date and time from a specified date, yielding a time interval.
Public operatorStatic memberSubtraction(Date, TimeSpan)
Subtracts a specified date and time from a specified date, yielding a time interval.

Fields

  NameDescription
Public fieldStatic memberMaxValue
Represents the largest possible value of Date. This field is read-only.
Public fieldStatic memberMinValue
Represents the smallest possible value of Date. This field is read-only.

Properties

  NameDescription
Public propertyDay
Gets the day of the month represented by this instance.
Public propertyDayOfWeek
Gets the day of the week represented by this instance.
Public propertyDayOfYear
Gets the day of the year represented by this instance.
Public propertyMonth
Gets the month component of the date represented by this instance.
Public propertyStatic memberToday
Gets the current date.
Public propertyYear
Gets the year component of the date represented by this instance.

See Also