DateTime Methods
The methods of the DateTime structure are listed here. For a complete list of DateTime structure members, see the DateTime Members topic.
Public Methods
Add Supported by the .NET Compact Framework. | Adds the value of the specified TimeSpan to the value of this instance. |
AddDays Supported by the .NET Compact Framework. | Adds the specified number of days to the value of this instance. |
AddHours Supported by the .NET Compact Framework. | Adds the specified number of hours to the value of this instance. |
AddMilliseconds Supported by the .NET Compact Framework. | Adds the specified number of milliseconds to the value of this instance. |
AddMinutes Supported by the .NET Compact Framework. | Adds the specified number of minutes to the value of this instance. |
AddMonths Supported by the .NET Compact Framework. | Adds the specified number of months to the value of this instance. |
AddSeconds Supported by the .NET Compact Framework. | Adds the specified number of seconds to the value of this instance. |
AddTicks Supported by the .NET Compact Framework. | Adds the specified number of ticks to the value of this instance. |
AddYears Supported by the .NET Compact Framework. | Adds the specified number of years to the value of this instance. |
![]() Compare Supported by the .NET Compact Framework. | Compares two instances of DateTime and returns an indication of their relative values. |
CompareTo Supported by the .NET Compact Framework. | Compares this instance to a specified object and returns an indication of their relative values. |
![]() DaysInMonth Supported by the .NET Compact Framework. | Returns the number of days in the specified month of the specified year. |
Equals Supported by the .NET Compact Framework. | Overloaded. Overridden. Returns a value indicating whether an instance of DateTime is equal to a specified object. |
![]() FromFileTime Supported by the .NET Compact Framework. | Returns a DateTime equivalent to the specified operating system file timestamp. |
![]() FromFileTimeUtc Supported by the .NET Compact Framework. | Returns a DateTime equivalent to the specified operating system file timestamp, adjusted to coordinated universal time (UTC). |
![]() FromOADate | Returns a DateTime equivalent to the specified OLE Automation Date. |
GetDateTimeFormats Supported by the .NET Compact Framework. | Overloaded. Converts the value of this instance to all the string representations supported by the standard DateTime format specifiers. |
GetHashCode Supported by the .NET Compact Framework. | Overridden. Returns the hash code for this instance. |
GetType (inherited from Object)
Supported by the .NET Compact Framework. | Gets the Type of the current instance. |
GetTypeCode Supported by the .NET Compact Framework. | Returns the TypeCode for value type DateTime. |
![]() IsLeapYear Supported by the .NET Compact Framework. | Returns an indication whether the specified year is a leap year. |
![]() Parse Supported by the .NET Compact Framework. | Overloaded. Converts the specified string representation of a date and time to its DateTime equivalent. |
![]() ParseExact Supported by the .NET Compact Framework. | Overloaded. 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. |
Subtract Supported by the .NET Compact Framework. | Overloaded. Subtracts the specified time or duration from this instance. |
ToFileTime Supported by the .NET Compact Framework. | Converts the value of this instance to the format of a local operating system file time. |
ToFileTimeUtc Supported by the .NET Compact Framework. | Converts the value of this instance to the format of operating system file time, ignoring the local time zone. |
ToLocalTime Supported by the .NET Compact Framework. | Converts the current coordinated universal time (UTC) to local time. |
ToLongDateString Supported by the .NET Compact Framework. | Converts the value of this instance to its equivalent long date string representation. |
ToLongTimeString Supported by the .NET Compact Framework. | Converts the value of this instance to its equivalent long time string representation. |
ToOADate | Converts the value of this instance to the equivalent OLE Automation date. |
ToShortDateString Supported by the .NET Compact Framework. | Converts the value of this instance to its equivalent short date string representation. |
ToShortTimeString Supported by the .NET Compact Framework. | Converts the value of this instance to its equivalent short time string representation. |
ToString Supported by the .NET Compact Framework. | Overloaded. Overridden. Converts the value of this instance to its equivalent string representation. |
ToUniversalTime Supported by the .NET Compact Framework. | Converts the current local time to coordinated universal time (UTC). |
Protected Methods
Finalize (inherited from Object)
Supported by the .NET Compact Framework. | Overridden. Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
In C# and C++, finalizers are expressed using destructor syntax. |
MemberwiseClone (inherited from Object)
Supported by the .NET Compact Framework. | Creates a shallow copy of the current Object. |
