DateTime Methods

DateTime Methods

 

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

NameDescription
System_CAPS_pubmethodAdd(TimeSpan)

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

System_CAPS_pubmethodAddDays(Double)

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

System_CAPS_pubmethodAddHours(Double)

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

System_CAPS_pubmethodAddMilliseconds(Double)

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

System_CAPS_pubmethodAddMinutes(Double)

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

System_CAPS_pubmethodAddMonths(Int32)

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

System_CAPS_pubmethodAddSeconds(Double)

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

System_CAPS_pubmethodAddTicks(Int64)

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

System_CAPS_pubmethodAddYears(Int32)

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

System_CAPS_pubmethodSystem_CAPS_staticCompare(DateTime, DateTime)

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.

System_CAPS_pubmethodCompareTo(DateTime)

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.

System_CAPS_pubmethodCompareTo(Object)

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.

System_CAPS_pubmethodSystem_CAPS_staticDaysInMonth(Int32, Int32)

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

System_CAPS_pubmethodEquals(DateTime)

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

System_CAPS_pubmethodSystem_CAPS_staticEquals(DateTime, DateTime)

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

System_CAPS_pubmethodEquals(Object)

Returns a value indicating whether this instance is equal to a specified object.(Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodSystem_CAPS_staticFromBinary(Int64)

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

System_CAPS_pubmethodSystem_CAPS_staticFromFileTime(Int64)

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

System_CAPS_pubmethodSystem_CAPS_staticFromFileTimeUtc(Int64)

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

System_CAPS_pubmethodSystem_CAPS_staticFromOADate(Double)

Returns a DateTime equivalent to the specified OLE Automation Date.

System_CAPS_pubmethodGetDateTimeFormats()

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

System_CAPS_pubmethodGetDateTimeFormats(Char)

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

System_CAPS_pubmethodGetDateTimeFormats(Char, IFormatProvider)

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.

System_CAPS_pubmethodGetDateTimeFormats(IFormatProvider)

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.

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this instance.(Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodGetTypeCode()

Returns the TypeCode for value type DateTime.

System_CAPS_pubmethodIsDaylightSavingTime()

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

System_CAPS_pubmethodSystem_CAPS_staticIsLeapYear(Int32)

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

System_CAPS_pubmethodSystem_CAPS_staticParse(String)

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

System_CAPS_pubmethodSystem_CAPS_staticParse(String, IFormatProvider)

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

System_CAPS_pubmethodSystem_CAPS_staticParse(String, IFormatProvider, DateTimeStyles)

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

System_CAPS_pubmethodSystem_CAPS_staticParseExact(String, String, IFormatProvider)

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.

System_CAPS_pubmethodSystem_CAPS_staticParseExact(String, String, IFormatProvider, DateTimeStyles)

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.

System_CAPS_pubmethodSystem_CAPS_staticParseExact(String, String[], IFormatProvider, DateTimeStyles)

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.

System_CAPS_pubmethodSystem_CAPS_staticSpecifyKind(DateTime, DateTimeKind)

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.

System_CAPS_pubmethodSubtract(DateTime)

Subtracts the specified date and time from this instance.

System_CAPS_pubmethodSubtract(TimeSpan)

Subtracts the specified duration from this instance.

System_CAPS_pubmethodToBinary()

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

System_CAPS_pubmethodToFileTime()

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

System_CAPS_pubmethodToFileTimeUtc()

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

System_CAPS_pubmethodToLocalTime()

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

System_CAPS_pubmethodToLongDateString()

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

System_CAPS_pubmethodToLongTimeString()

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

System_CAPS_pubmethodToOADate()

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

System_CAPS_pubmethodToShortDateString()

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

System_CAPS_pubmethodToShortTimeString()

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

System_CAPS_pubmethodToString()

Converts the value of the current DateTime object to its equivalent string representation using the formatting conventions of the current culture.(Overrides ValueType.ToString().)

System_CAPS_pubmethodToString(IFormatProvider)

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

System_CAPS_pubmethodToString(String)

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

System_CAPS_pubmethodToString(String, IFormatProvider)

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

System_CAPS_pubmethodToUniversalTime()

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

System_CAPS_pubmethodSystem_CAPS_staticTryParse(String, DateTime)

Converts the specified string representation of a date and time to its DateTime equivalent and returns a value that indicates whether the conversion succeeded.

System_CAPS_pubmethodSystem_CAPS_staticTryParse(String, IFormatProvider, DateTimeStyles, DateTime)

Converts the specified string representation of a date and time to its DateTime equivalent using the specified culture-specific format information and formatting style, and returns a value that indicates whether the conversion succeeded.

System_CAPS_pubmethodSystem_CAPS_staticTryParseExact(String, String, IFormatProvider, 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. The method returns a value that indicates whether the conversion succeeded.

System_CAPS_pubmethodSystem_CAPS_staticTryParseExact(String, String[], IFormatProvider, 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. The method returns a value that indicates whether the conversion succeeded.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToBoolean(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToByte(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToChar(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToDateTime(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. Returns the current DateTime object.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToDecimal(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToDouble(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToInt16(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToInt32(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToInt64(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToSByte(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToSingle(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToType(Type, IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. Converts the current DateTime object to an object of a specified type.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToUInt16(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToUInt32(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIConvertible.ToUInt64(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

System_CAPS_pubinterfaceSystem_CAPS_privmethodISerializable.GetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo object with the data needed to serialize the current DateTime object.

Return to top
Show:
© 2016 Microsoft