Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
System Namespace
DateTime Structure
DateTime Methods
Collapse All/Expand All Collapse All
Members FilterMembers Filter
Frameworks FilterFrameworks Filter
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
DateTime Methods

The DateTime type exposes the following members.

  NameDescription
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAddAdds the value of the specified TimeSpan to the value of this instance.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAddDaysAdds the specified number of days to the value of this instance.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAddHoursAdds the specified number of hours to the value of this instance.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAddMillisecondsAdds the specified number of milliseconds to the value of this instance.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAddMinutesAdds the specified number of minutes to the value of this instance.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAddMonthsAdds the specified number of months to the value of this instance.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAddSecondsAdds the specified number of seconds to the value of this instance.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAddTicksAdds the specified number of ticks to the value of this instance.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAddYearsAdds the specified number of years to the value of this instance.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkCompareCompares 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.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkCompareToOverloaded. Compares the value of this instance to a specified DateTime value and indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkDaysInMonthReturns the number of days in the specified month and year.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkEqualsOverloaded. Returns a value indicating whether two DateTime objects, or a DateTime instance and another object or DateTime are equal.
Protected methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkFinalizeAllows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberFromBinaryDeserializes a 64-bit binary value and recreates an original serialized DateTime object.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkFromFileTimeConverts the specified Windows file time to an equivalent local time.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkFromFileTimeUtcConverts the specified Windows file time to an equivalent UTC time.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkFromOADateReturns a DateTime equivalent to the specified OLE Automation Date.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetDateTimeFormatsOverloaded. Converts the value of this instance to all the string representations supported by the standard DateTime format specifiers.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetHashCodeReturns the hash code for this instance. (Overrides ValueType..::.GetHashCode()()().)
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetTypeCodeReturns the TypeCode for value type DateTime.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIsDaylightSavingTimeIndicates whether this instance of DateTime is within the Daylight Saving Time range for the current time zone.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIsLeapYearReturns an indication whether the specified year is a leap year.
Protected methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkParseOverloaded. Converts the specified string representation of a date and time to its DateTime equivalent.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkParseExactOverloaded. Converts the specified string representation of a date and time to its DateTime equivalent. The format of the string representation must match a specified format exactly or an exception is thrown.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkSpecifyKindCreates a new DateTime object that represents the same time as the specified DateTime, but is designated in either local time, Coordinated Universal Time (UTC), or neither, as indicated by the specified DateTimeKind value.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkSubtractOverloaded. Subtracts the specified time or duration from this instance.
Public methodToBinarySerializes the current DateTime object to a 64-bit binary value that subsequently can be used to recreate the DateTime object.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToFileTimeConverts the value of the current DateTime object to a Windows file time.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToFileTimeUtcConverts the value of the current DateTime object to a Windows file time.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToLocalTimeConverts the value of the current DateTime object to local time.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToLongDateStringConverts the value of the current DateTime object to its equivalent long date string representation.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToLongTimeStringConverts the value of the current DateTime object to its equivalent long time string representation.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToOADateConverts the value of this instance to the equivalent OLE Automation date.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToShortDateStringConverts the value of the current DateTime object to its equivalent short date string representation.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToShortTimeStringConverts the value of the current DateTime object to its equivalent short time string representation.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToStringOverloaded. Converts the value of the current DateTime object to its equivalent string representation.
Public methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkToUniversalTimeConverts the value of the current DateTime object to Coordinated Universal Time (UTC).
Public methodStatic memberTryParseOverloaded. Converts the specified string representation of a date and time to its DateTime equivalent and returns a value that indicates whether the conversion succeeded.
Public methodStatic memberTryParseExactOverloaded. Converts the specified string representation of a date and time to its DateTime equivalent. The format of the string representation must match a specified format exactly. The method returns a value that indicates whether the conversion succeeded.
Top
  NameDescription
Public operatorStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAdditionAdds a specified time interval to a specified date and time, yielding a new date and time.
Public operatorStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkEqualityDetermines whether two specified instances of DateTime are equal.
Public operatorStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGreaterThanDetermines whether one specified DateTime is greater than another specified DateTime.
Public operatorStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGreaterThanOrEqualDetermines whether one specified DateTime is greater than or equal to another specified DateTime.
Public operatorStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkInequalityDetermines whether two specified instances of DateTime are not equal.
Public operatorStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkLessThanDetermines whether one specified DateTime is less than another specified DateTime.
Public operatorStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkLessThanOrEqualDetermines whether one specified DateTime is less than or equal to another specified DateTime.
Public operatorStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkSubtractionOverloaded. Subtracts a specified DateTime or TimeSpan from a specified DateTime.
Top
  NameDescription
Explicit interface implemetationPrivate methodISerializable..::.GetObjectDataPopulates a SerializationInfo object with the data needed to serialize the current DateTime object.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToBooleanInfrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToByteInfrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToCharInfrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToDateTimeInfrastructure. Returns the current DateTime object.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToDecimalInfrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToDoubleInfrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToInt16Infrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToInt32Infrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToInt64Infrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToSByteInfrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToSingleInfrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToTypeInfrastructure. Converts the current DateTime object to an object of a specified type.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToUInt16Infrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToUInt32Infrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Explicit interface implemetationPrivate methodSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIConvertible..::.ToUInt64Infrastructure. This conversion is not supported. Attempting to use this method throws an InvalidCastException.
Top
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker