Export (0) Print
Expand All
4 out of 11 rated this helpful - Rate this topic

DateTime Members

DateTime overview

Public Constructors

public constructorDateTime Constructor

Supported by the .NET Compact Framework.

Overloaded. Initializes a new instance of the DateTime structure.

Public Fields

public fieldstatic (Shared in Visual Basic)MaxValue

Supported by the .NET Compact Framework.

Represents the largest possible value of DateTime. This field is read-only.
public fieldstatic (Shared in Visual Basic)MinValue

Supported by the .NET Compact Framework.

Represents the smallest possible value of DateTime. This field is read-only.

Public Properties

public propertyDate

Supported by the .NET Compact Framework.

Gets the date component of this instance.
public propertyDay

Supported by the .NET Compact Framework.

Gets the day of the month represented by this instance.
public propertyDayOfWeek

Supported by the .NET Compact Framework.

Gets the day of the week represented by this instance.
public propertyDayOfYear

Supported by the .NET Compact Framework.

Gets the day of the year represented by this instance.
public propertyHour

Supported by the .NET Compact Framework.

Gets the hour component of the date represented by this instance.
public propertyMillisecond

Supported by the .NET Compact Framework.

Gets the milliseconds component of the date represented by this instance.
public propertyMinute

Supported by the .NET Compact Framework.

Gets the minute component of the date represented by this instance.
public propertyMonth

Supported by the .NET Compact Framework.

Gets the month component of the date represented by this instance.
public propertystatic (Shared in Visual Basic)Now

Supported by the .NET Compact Framework.

Gets a DateTime that is the current local date and time on this computer.
public propertySecond

Supported by the .NET Compact Framework.

Gets the seconds component of the date represented by this instance.
public propertyTicks

Supported by the .NET Compact Framework.

Gets the number of ticks that represent the date and time of this instance.
public propertyTimeOfDay

Supported by the .NET Compact Framework.

Gets the time of day for this instance.
public propertystatic (Shared in Visual Basic)Today

Supported by the .NET Compact Framework.

Gets the current date.
public propertystatic (Shared in Visual Basic)UtcNow

Supported by the .NET Compact Framework.

Gets a DateTime that is the current local date and time on this computer expressed as the coordinated universal time (UTC).
public propertyYear

Supported by the .NET Compact Framework.

Gets the year component of the date represented by this instance.

Public Methods

public methodAdd

Supported by the .NET Compact Framework.

Adds the value of the specified TimeSpan to the value of this instance.
public methodAddDays

Supported by the .NET Compact Framework.

Adds the specified number of days to the value of this instance.
public methodAddHours

Supported by the .NET Compact Framework.

Adds the specified number of hours to the value of this instance.
public methodAddMilliseconds

Supported by the .NET Compact Framework.

Adds the specified number of milliseconds to the value of this instance.
public methodAddMinutes

Supported by the .NET Compact Framework.

Adds the specified number of minutes to the value of this instance.
public methodAddMonths

Supported by the .NET Compact Framework.

Adds the specified number of months to the value of this instance.
public methodAddSeconds

Supported by the .NET Compact Framework.

Adds the specified number of seconds to the value of this instance.
public methodAddTicks

Supported by the .NET Compact Framework.

Adds the specified number of ticks to the value of this instance.
public methodAddYears

Supported by the .NET Compact Framework.

Adds the specified number of years to the value of this instance.
public methodstatic (Shared in Visual Basic)Compare

Supported by the .NET Compact Framework.

Compares two instances of DateTime and returns an indication of their relative values.
public methodCompareTo

Supported by the .NET Compact Framework.

Compares this instance to a specified object and returns an indication of their relative values.
public methodstatic (Shared in Visual Basic)DaysInMonth

Supported by the .NET Compact Framework.

Returns the number of days in the specified month of the specified year.
public methodEquals

Supported by the .NET Compact Framework.

Overloaded. Overridden. Returns a value indicating whether an instance of DateTime is equal to a specified object.
public methodstatic (Shared in Visual Basic)FromFileTime

Supported by the .NET Compact Framework.

Returns a DateTime equivalent to the specified operating system file timestamp.
public methodstatic (Shared in Visual Basic)FromFileTimeUtc

Supported by the .NET Compact Framework.

Returns a DateTime equivalent to the specified operating system file timestamp, adjusted to coordinated universal time (UTC).
public methodstatic (Shared in Visual Basic)FromOADate Returns a DateTime equivalent to the specified OLE Automation Date.
public methodGetDateTimeFormats

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.
public methodGetHashCode

Supported by the .NET Compact Framework.

Overridden. Returns the hash code for this instance.
public methodGetType (inherited from Object)

Supported by the .NET Compact Framework.

Gets the Type of the current instance.
public methodGetTypeCode

Supported by the .NET Compact Framework.

Returns the TypeCode for value type DateTime.
public methodstatic (Shared in Visual Basic)IsLeapYear

Supported by the .NET Compact Framework.

Returns an indication whether the specified year is a leap year.
public methodstatic (Shared in Visual Basic)Parse

Supported by the .NET Compact Framework.

Overloaded. Converts the specified string representation of a date and time to its DateTime equivalent.
public methodstatic (Shared in Visual Basic)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.
public methodSubtract

Supported by the .NET Compact Framework.

Overloaded. Subtracts the specified time or duration from this instance.
public methodToFileTime

Supported by the .NET Compact Framework.

Converts the value of this instance to the format of a local operating system file time.
public methodToFileTimeUtc

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.
public methodToLocalTime

Supported by the .NET Compact Framework.

Converts the current coordinated universal time (UTC) to local time.
public methodToLongDateString

Supported by the .NET Compact Framework.

Converts the value of this instance to its equivalent long date string representation.
public methodToLongTimeString

Supported by the .NET Compact Framework.

Converts the value of this instance to its equivalent long time string representation.
public methodToOADate Converts the value of this instance to the equivalent OLE Automation date.
public methodToShortDateString

Supported by the .NET Compact Framework.

Converts the value of this instance to its equivalent short date string representation.
public methodToShortTimeString

Supported by the .NET Compact Framework.

Converts the value of this instance to its equivalent short time string representation.
public methodToString

Supported by the .NET Compact Framework.

Overloaded. Overridden. Converts the value of this instance to its equivalent string representation.
public methodToUniversalTime

Supported by the .NET Compact Framework.

Converts the current local time to coordinated universal time (UTC).

Public Operators

public operatorstatic (Shared in Visual Basic)Addition Operator

Supported by the .NET Compact Framework.

Adds a specified time interval to a specified date and time, yielding a new date and time.
public operatorstatic (Shared in Visual Basic)Equality Operator

Supported by the .NET Compact Framework.

Determines whether two specified instances of DateTime are equal.
public operatorstatic (Shared in Visual Basic)Greater Than Operator

Supported by the .NET Compact Framework.

Determines whether one specified DateTime is greater than another specified DateTime.
public operatorstatic (Shared in Visual Basic)Greater Than Or Equal Operator

Supported by the .NET Compact Framework.

Determines whether one specified DateTime is greater than or equal to another specified DateTime.
public operatorstatic (Shared in Visual Basic)Inequality Operator

Supported by the .NET Compact Framework.

Determines whether two specified instances of DateTime are not equal.
public operatorstatic (Shared in Visual Basic)Less Than Operator

Supported by the .NET Compact Framework.

Determines whether one specified DateTime is less than another specified DateTime.
public operatorstatic (Shared in Visual Basic)Less Than Or Equal Operator

Supported by the .NET Compact Framework.

Determines whether one specified DateTime is less than or equal to another specified DateTime.
public operatorstatic (Shared in Visual Basic)Subtraction Operator

Supported by the .NET Compact Framework.

Overloaded. Subtracts a specified DateTime or TimeSpan from a specified DateTime.

Protected Methods

protected methodFinalize (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.

protected methodMemberwiseClone (inherited from Object)

Supported by the .NET Compact Framework.

Creates a shallow copy of the current Object.

See Also

DateTime Structure | System Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.