The Date type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| Date(DateTime) |
Initializes a new instance of the Date structure.
| |
| Date(Int32, Int32, Int32) |
Initializes a new instance of the Date structure to the specified year, month, and day.
| |
| Date(Int32, Int32, Int32, Calendar) |
Initializes a new instance of the Date structure to the specified year, month, and day for the specified calendar.
|
Methods
| Name | Description | |
|---|---|---|
| Add |
Adds the value of the specified TimeSpan to the value of this instance.
| |
| AddDays |
Adds the specified number of days to the value of this instance.
| |
| AddHours |
Adds the specified number of hours to the value of this instance.
| |
| AddMilliseconds |
Adds the specified number of milliseconds to the value of this instance.
| |
| AddMinutes |
Adds the specified number of minutes to the value of this instance.
| |
| AddMonths |
Adds the specified number of months to the value of this instance.
| |
| AddSeconds |
Adds the specified number of seconds to the value of this instance.
| |
| AddTicks |
Adds the specified number of ticks to the value of this instance.
| |
| AddYears |
Adds the specified number of years to the value of this instance.
| |
| Compare |
Compares two instances of Date and returns an indication of their relative values.
| |
| CompareTo(Object) | ||
| CompareTo(Date) | ||
| DaysInMonth |
Returns the number of days in the specified month and year.
| |
| Equals(Object) |
Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueType..::..Equals(Object).) | |
| Equals(Date) |
Returns a value indicating whether this instance is equal to the specified Date instance.
| |
| Equals(Date, Date) |
Returns a value indicating whether two instances of Date are equal.
| |
| Finalize | (Inherited from Object.) | |
| GetHashCode |
Returns the hash code for this instance.
(Overrides ValueType..::..GetHashCode()()()().) | |
| GetType | (Inherited from Object.) | |
| IsLeapYear |
Returns an indication whether the specified year is a leap year.
| |
| MemberwiseClone | (Inherited from Object.) | |
| Parse(String) |
Converts the specified string representation of a date to its Date equivalent.
| |
| Parse(String, IFormatProvider) |
Converts the specified string representation of a date to its Date equivalent using the specified culture-specific format information.
| |
| Parse(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.
| |
| ParseExact(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.
| |
| ParseExact(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.
| |
| ParseExact(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.
| |
| Subtract(DateTime) |
Subtracts the specified date and time from this instance.
| |
| Subtract(TimeSpan) |
Subtracts the specified duration from this instance.
| |
| ToDateTime |
Returns a date time value based on the current date value, having no time information.
| |
| ToLongDateString |
Converts the value of the current Date object to its equivalent long date string representation.
| |
| ToShortDateString |
Converts the value of the current Date object to its equivalent short date string representation.
| |
| ToString()()()() |
Converts the value of the current Date object to its equivalent string representation.
(Overrides ValueType..::..ToString()()()().) | |
| ToString(IFormatProvider) |
Converts the value of the current Date object to its equivalent string representation using the specified culture-specific format information.
| |
| ToString(String) |
Converts the value of the current Date object to its equivalent string representation using the specified format.
| |
| ToString(String, IFormatProvider) |
Converts the value of the current Date object to its equivalent string representation using the specified format and culture-specific format information.
| |
| TryParse(String, Date%) |
Converts the specified string representation of a date to its Date equivalent.
| |
| TryParse(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.
| |
| TryParseExact(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.
| |
| TryParseExact(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
| Name | Description | |
|---|---|---|
| Addition |
Adds a specified time interval to a specified date, yielding a new date and time.
| |
| Equality | ||
| GreaterThan | ||
| GreaterThanOrEqual | ||
| ImplicitWideningImplicitImplicitImplicit(DateTime to Date) |
Casts a date and time value to a date value.
| |
| ImplicitWideningImplicitImplicitImplicit(Date to DateTime) |
Casts a date value to a date and time value.
| |
| Inequality | ||
| LessThan | ||
| LessThanOrEqual | ||
| Subtraction(Date, DateTime) |
Subtracts a specified date and time from a specified date, yielding a time interval.
| |
| Subtraction(Date, TimeSpan) |
Subtracts a specified date and time from a specified date, yielding a time interval.
|
Fields
| Name | Description | |
|---|---|---|
| MaxValue |
Represents the largest possible value of Date. This field is read-only.
| |
| MinValue |
Represents the smallest possible value of Date. This field is read-only.
|
Properties
| Name | Description | |
|---|---|---|
| Day |
Gets the day of the month represented by this instance.
| |
| DayOfWeek |
Gets the day of the week represented by this instance.
| |
| DayOfYear |
Gets the day of the year represented by this instance.
| |
| Month |
Gets the month component of the date represented by this instance.
| |
| Today |
Gets the current date.
| |
| Year |
Gets the year component of the date represented by this instance.
|