System.DateTime: Method Members

The methods of System.DateTime are listed below. For a list of all members, see the DateTime Members list.

See Also: Inherited members from System.ValueType

Public Methods

Add(TimeSpan) : DateTime

Returns a new DateTime that adds the value of the specified TimeSpan to the value of this instance.

AddDays(double) : DateTime

Returns a new DateTime that adds the specified number of days to the value of this instance.

AddHours(double) : DateTime

Returns a new DateTime that adds the specified number of hours to the value of this instance.

AddMilliseconds(double) : DateTime

Returns a new DateTime that adds the specified number of milliseconds to the value of this instance.

AddMinutes(double) : DateTime

Returns a new DateTime that adds the specified number of minutes to the value of this instance.

AddMonths(int) : DateTime

Returns a new DateTime that adds the specified number of months to the value of this instance.

AddSeconds(double) : DateTime

Returns a new DateTime that adds the specified number of seconds to the value of this instance.

AddTicks(long) : DateTime

Returns a new DateTime that adds the specified number of ticks to the value of this instance.

AddYears(int) : DateTime

Returns a new DateTime that adds the specified number of years to the value of this instance.

static
Compare(DateTime, DateTime) : int

Compares two instances of DateTime and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance.

CompareTo(DateTime) : int

Compares the value of this instance to a specified DateTime value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.

CompareTo(object) : int

Compares the value of this instance to a specified object that contains a specified DateTime value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.

static
DaysInMonth(int, int) : int

Returns the number of days in the specified month and year.

Equals(DateTime) : bool

Returns a value indicating whether the value of this instance is equal to the value of the specified DateTime instance.

override
Equals(object) : bool

Returns a value indicating whether this instance is equal to a specified object.

static
Equals(DateTime, DateTime) : bool

Returns a value indicating whether two DateTime instances have the same date and time value.

static
FromBinary(long) : DateTime

Deserializes a 64-bit binary value and recreates an original serialized DateTime object.

static
FromFileTime(long) : DateTime

Converts the specified Windows file time to an equivalent local time.

static
FromFileTimeUtc(long) : DateTime

Converts the specified Windows file time to an equivalent UTC time.

static
FromOADate(double) : DateTime

Returns a DateTime equivalent to the specified OLE Automation Date.

GetDateTimeFormats() : string[]

Converts the value of this instance to all the string representations supported by the standard date and time format specifiers.

GetDateTimeFormats(char) : string[]

Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier.

GetDateTimeFormats(IFormatProvider) : string[]

Converts the value of this instance to all the string representations supported by the standard date and time format specifiers and the specified culture-specific formatting information.

GetDateTimeFormats(char, IFormatProvider) : string[]

Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier and culture-specific formatting information.

override
GetHashCode() : int

Returns the hash code for this instance.

GetTypeCode() : TypeCode

Returns the TypeCode for value type DateTime.

IsDaylightSavingTime() : bool

Indicates whether this instance of DateTime is within the daylight saving time range for the current time zone.

static
IsLeapYear(int) : bool

Returns an indication whether the specified year is a leap year.

static
Parse(string) : DateTime

Converts the string representation of a date and time to its DateTime equivalent.

static
Parse(string, IFormatProvider) : DateTime

Converts the string representation of a date and time to its DateTime equivalent by using culture-specific format information.

static
Parse(string, IFormatProvider, System.Globalization.DateTimeStyles) : DateTime

Converts the string representation of a date and time to its DateTime equivalent by using culture-specific format information and formatting style.

static
ParseExact(string, string, IFormatProvider) : DateTime

Converts the specified string representation of a date and time to its DateTime equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

static
ParseExact(string, string, IFormatProvider, System.Globalization.DateTimeStyles) : DateTime

Converts the specified string representation of a date and time to its DateTime equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly or an exception is thrown.

static
ParseExact(string, string[], IFormatProvider, System.Globalization.DateTimeStyles) : DateTime

Converts the specified string representation of a date and time to its DateTime equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match at least one of the specified formats exactly or an exception is thrown.

static
SpecifyKind(DateTime, DateTimeKind) : DateTime

Creates a new DateTime object that has the same number of ticks as the specified DateTime, but is designated as either local time, Coordinated Universal Time (UTC), or neither, as indicated by the specified DateTimeKind value.

Subtract(DateTime) : TimeSpan

Subtracts the specified date and time from this instance.

Subtract(TimeSpan) : DateTime

Subtracts the specified duration from this instance.

ToBinary() : long

Serializes the current DateTime object to a 64-bit binary value that subsequently can be used to recreate the DateTime object.

ToFileTime() : long

Converts the value of the current DateTime object to a Windows file time.

ToFileTimeUtc() : long

Converts the value of the current DateTime object to a Windows file time.

ToLocalTime() : DateTime

Converts the value of the current DateTime object to local time.

ToLongDateString() : string

Converts the value of the current DateTime object to its equivalent long date string representation.

ToLongTimeString() : string

Converts the value of the current DateTime object to its equivalent long time string representation.

ToOADate() : double

Converts the value of this instance to the equivalent OLE Automation date.

ToShortDateString() : string

Converts the value of the current DateTime object to its equivalent short date string representation.

ToShortTimeString() : string

Converts the value of the current DateTime object to its equivalent short time string representation.

override
ToString() : string

Converts the value of the current DateTime object to its equivalent string representation.

ToString(IFormatProvider) : string

Converts the value of the current DateTime object to its equivalent string representation using the specified culture-specific format information.

ToString(string) : string

Converts the value of the current DateTime object to its equivalent string representation using the specified format.

ToString(string, IFormatProvider) : string

Converts the value of the current DateTime object to its equivalent string representation using the specified format and culture-specific format information.

ToUniversalTime() : DateTime

Converts the value of the current DateTime object to Coordinated Universal Time (UTC).

static
TryParse(string, out DateTime) : bool
Documentation for this section has not yet been entered.
static
TryParse(string, IFormatProvider, System.Globalization.DateTimeStyles, out DateTime) : bool
Documentation for this section has not yet been entered.
static
TryParseExact(string, string, IFormatProvider, System.Globalization.DateTimeStyles, out DateTime) : bool
Documentation for this section has not yet been entered.
static
TryParseExact(string, string[], IFormatProvider, System.Globalization.DateTimeStyles, out DateTime) : bool
Documentation for this section has not yet been entered.