DateTime Methods

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

The DateTime type exposes the following members.

  Name Description
Public method Add Returns a new DateTime that adds the value of the specified TimeSpan to the value of this instance.
Public method AddDays Returns a new DateTime that adds the specified number of days to the value of this instance.
Public method AddHours Returns a new DateTime that adds the specified number of hours to the value of this instance.
Public method AddMilliseconds Returns a new DateTime that adds the specified number of milliseconds to the value of this instance.
Public method AddMinutes Returns a new DateTime that adds the specified number of minutes to the value of this instance.
Public method AddSeconds Returns a new DateTime that adds the specified number of seconds to the value of this instance.
Public method AddTicks Returns a new DateTime that adds the specified number of ticks to the value of this instance.
Public method Static member Compare 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.
Public method CompareTo 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.
Public method Static member DaysInMonth Returns the number of days in the specified month and year.
Public method Equals(Object) Returns a value indicating whether this instance is equal to a specified object. (Overrides ValueType..::..Equals(Object).)
Public method Static member Equals(DateTime, DateTime) Returns a value indicating whether two DateTime instances have the same date and time value.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Static member SpecifyKind 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.
Public method Subtract(DateTime) Subtracts the specified date and time from this instance.
Public method Subtract(TimeSpan) Subtracts the specified duration from this instance.
Public method ToLocalTime Converts the value of the current DateTime object to local time.
Public method ToString()()()() Converts the value of the current DateTime object to its equivalent string representation. (Overrides Object..::..ToString()()()().)
Public method ToString(String) Converts the value of the current DateTime object to its equivalent string representation using the specified format.
Public method ToUniversalTime Converts the value of the current DateTime object to Coordinated Universal Time (UTC).
Top
Show: