System.DateTime Structure

Represents an instant in time, typically expressed as a date and time of day.

See Also: DateTime

Syntax

Remarks

The DateTime value type represents dates and times with values ranging from 00:00:00 (midnight), January 1, 0001 Anno Domini (Common Era) through 11:59:59 P.M., December 31, 9999 A.D. (C.E.) in the Gregorian calendar.

Time values are measured in 100-nanosecond units called ticks, and a particular date is the number of ticks since 12:00 midnight, January 1, 0001 A.D. (C.E.) in the GregorianCalendar calendar (excluding ticks that would be added by leap seconds). For example, a ticks value of 31241376000000000L represents the date, Friday, January 01, 0100 12:00:00 midnight. A DateTime value is always expressed in the context of an explicit or default calendar.

Note:

If you are working with a ticks value that you want to convert to some other time interval, such as minutes or seconds, you should use the TimeSpan.TicksPerDay, TimeSpan.TicksPerHour, TimeSpan.TicksPerMinute, TimeSpan.TicksPerSecond, or TimeSpan.TicksPerMillisecond constant to perform the conversion. For example, to add the number of seconds represented by a specified number of ticks to the DateTime.Second component of a DateTime value, you can use the expression dateValue.Second + nTicks/Timespan.TicksPerSecond.

In this section:

Instantiating a DateTime objectDateTime values and their string representationsConverting strings to DateTime valuesVersion considerationsDateTime valuesDateTime operationsDateTime vs. TimeSpanCOM interop considerations

Instantiating a DateTime object

You can create a new DateTime value in any of the following ways:

  • By calling any of the overloads of the DateTime constructor that allow you to specify specific elements of the date and time value (such as the year, month, and day, or the number of ticks). The following statement illustrates a call to one of the DateTime constructors to create a date with a specific year, month, day, hour, minute, and second.

    code reference: System.DateTime.Instantiation#1

  • By using any compiler-specific syntax for declaring date and time values. For example, the following Visual Basic statement initializes a new DateTime value.

    code reference: System.DateTime.Instantiation#2

  • By assigning the DateTime object a date and time value returned by a property or method. The following example assigns the current date and time, the current Coordinated Universal Time (UTC) date and time, and the current date to three new DateTime variables.

    code reference: System.DateTime.Instantiation#3

  • By parsing the string representation of a date and time value. The erload:System.DateTime.Parse, erload:System.DateTime.ParseExact, erload:System.DateTime.TryParse, and erload:System.DateTime.TryParseExact methods all convert a string to its equivalent date and time value. The following example uses the DateTime.Parse(String,IFormatProvider) method to parse a string and convert it to a DateTime value.

    code reference: System.DateTime.Instantiation#4

    Note that the erload:System.DateTime.TryParse and erload:System.DateTime.TryParseExact methods indicate whether a particular string contains a valid representation of a DateTime value in addition to performing the conversion.

  • By calling the DateTime structure's implicit default constructor. (For details on the implicit default constructor of a value type, see Value Types (C# Reference).) An approximate equivalent, for compilers that support it, is declaring a DateTime value without explicitly assigning a date and time to it. The following example illustrates a call to the DateTime implicit default constructor in C# and Visual Basic, as well as a DateTime variable declaration with no assignment in Visual Basic.

    code reference: System.DateTime.Instantiation#5

DateTime Values and their string representations

Internally, all DateTime values are represented as the number of ticks (the number of 100-nanosecond intervals) that have elapsed since 12:00:00 midnight, January 1, 0001. The actual DateTime value is independent of the way in which that value appears when displayed in a user interface element or when written to a file. The appearance of a DateTime value is the result of a formatting operation. Formatting is the process of converting a value to its string representation.

Because the appearance of date and time values is dependent on such factors as culture, international standards, application requirements, and personal preference, the DateTime structure offers a great deal of flexibility in formatting date and time values through the overloads of its erload:System.DateTime.ToString method. The default DateTime.ToString method returns the string representation of a date and time value using the current culture's short date and long time pattern. The following example uses the default DateTime.ToString method to display the date and time using the short date and long time pattern for the en-US culture, the current culture on the computer on which the example was run.

code reference: System.DateTime.Formatting#1

The DateTime.ToString(IFormatProvider) method returns the string representation of a date and time value using the short date and long time pattern of a specific culture. The following example uses the DateTime.ToString(IFormatProvider) method to display the date and time using the short date and long time pattern for the fr-FR culture.

code reference: System.DateTime.Formatting#2

The DateTime.ToString(String) method returns the string representation of the date and time in a format defined by a standard or custom format specifier and using the formatting conventions of the current culture. The following example uses the DateTime.ToString(String) method to display the full date and time pattern for the en-US culture, the current culture on the computer on which the example was run.

code reference: System.DateTime.Formatting#3

The DateTime.ToString(String,IFormatProvider) method returns the string representation of the date and time in a format defined by a specific format specifier and using the formatting conventions of a specific culture. The following example uses the DateTime.ToString(String,IFormatProvider) method to display the full date and time pattern for the fr-FR culture.

code reference: System.DateTime.Formatting#4

For more information about formatting DateTime values, see Standard Date and Time Format Strings and Custom Date and Time Format Strings.

Converting strings to DateTime values

Parsing involves converting the string representation of a date and time to a DateTime value. Typically, date and time strings have two different usages in applications:

  • They represent a date and time that can take a variety of forms and that reflect the conventions of either the current culture or a specific culture. For example, an application may allow a user whose current culture is en-US to input a date value as "12/15/2013" or "December 15, 2013", and allow a user whose current culture is en-GB to input a date value as "15/12/2013" or "15 December 2013".

  • They represent a date and time in a predefined format. For example, an application may serialize a date as "20130103" independently of the culture on which the app is running, or it may require that a date be input in the current culture's short date format.

You can use the DateTime.Parse(String) or DateTime.TryParse(String,DateTime) method to convert a string that might reflect one of the common date and time formats used by a culture to a DateTime value. The following example shows how you can use DateTime.TryParse(String,DateTime) to convert date strings in a number of different culture-specific formats to a DateTime value. It changes the current culture to English (Great Britain) and calls the DateTime.GetDateTimeFormats method to generate an array of date and time strings. It then passes each element in the array to the DateTime.TryParse(String,DateTime) method. The output from the example shows that the parsing method was able to successfully convert each of the culture-specific date and time strings.

code reference: System.DateTime.Parsing#1

You can use the DateTime.TryParse(String,DateTime) and DateTime.TryParseExact(String,String,IFormatProvider,DateTimeStyles,DateTime) methods to convert a date and time string that must match a particular format or formats to a DateTime value. You specify the required format or formats as a parameter to the parsing method by using one or more standard or custom date and time format strings. The following example uses the DateTime.TryParseExact(String,String[],IFormatProvider,DateTimeStyles,DateTime) method to convert strings that must be either in a "yyyyMMdd" format or a "HHmmss" format to DateTime values.

code reference: System.DateTime.Parsing#2

The DateTime.Parse(String) and DateTime.ParseExact(String,String,IFormatProvider) methods throw an exception if the string to be converted to a DateTime value cannot be parsed. The DateTime.TryParse(String,DateTime) and DateTime.TryParseExact(String,String,IFormatProvider,DateTimeStyles,DateTime) methods return a Boolean value that indicates whether the conversion succeeded or failed. Because the parsing operation for date and time strings, particularly if strings are input by users, tends to have a high failure rate, and because exception handling is expensive, you should use the DateTime.TryParse(String,DateTime) or DateTime.TryParseExact(String,String,IFormatProvider,DateTimeStyles,DateTime) methods in scenarios where performance is important or conversions are subject to a high rate of failure.

For more information about parsing date and time values, see Parsing Date and Time Strings.

Version considerations

Prior to the .NET Framework version 2.0, the DateTime structure contains a 64-bit field composed of an unused 2-bit field concatenated with a private Ticks field, which is a 62-bit unsigned field that contains the number of ticks that represent the date and time. The value of the Ticks field can be obtained with the DateTime.Ticks property.

Starting with the .NET Framework 2.0, the DateTime structure contains a 64-bit field composed of a private Kind field concatenated with the Ticks field. The Kind field is a 2-bit field that indicates whether the DateTime structure represents a local time, a Coordinated Universal Time (UTC), or the time in an unspecified time zone. The Kind field is used when performing time conversions between time zones, but not for time comparisons or arithmetic. The value of the Kind field can be obtained with the DateTime.Kind property.

Note:

An alternative to the DateTime structure for working with date and time values in particular time zones is the DateTimeOffset structure. The DateTimeOffset structure stores date and time information in a private DateTime field and the number of minutes by which that date and time differs from UTC in a private Int16 field. This makes it possible for a DateTimeOffset value to reflect the time in a particular time zone, whereas a DateTime value can unambiguously reflect only UTC and the local time zone's time. For a discussion about when to use the DateTime structure or the DateTimeOffset structure when working with date and time values, see Choosing Between DateTime, DateTimeOffset, and TimeZoneInfo.

DateTime values

Descriptions of time values in the DateTime type are often expressed using the Coordinated Universal Time (UTC) standard, which is the internationally recognized name for Greenwich Mean Time (GMT). Coordinated Universal Time is the time as measured at zero degrees longitude, the UTC origin point. Daylight saving time is not applicable to UTC.

Local time is relative to a particular time zone. A time zone is associated with a time zone offset, which is the displacement of the time zone measured in hours from the UTC origin point. In addition, local time is optionally affected by daylight saving time, which adds or subtracts an hour from the length of a day. Consequently, local time is calculated by adding the time zone offset to UTC and adjusting for daylight saving time if necessary. The time zone offset at the UTC origin point is zero.

UTC time is suitable for calculations, comparisons, and storing dates and time in files. Local time is appropriate for display in user interfaces of desktop applications. Time zone-aware applications (such as many Web applications) also need to work with a number of other time zones.

If the DateTime.Kind property of a DateTime object is DateTimeKind.Unspecified, it is unspecified whether the time represented is local time, UTC time, or a time in some other time zone.

DateTime operations

A calculation using a DateTime structure, such as DateTime.Add(TimeSpan) or DateTime.Subtract(DateTime), does not modify the value of the structure. Instead, the calculation returns a new DateTime structure whose value is the result of the calculation.

Conversion operations between time zones (such as between UTC and local time, or between one time zone and another) take daylight saving time into account, but arithmetic and comparison operations do not.

The DateTime structure itself offers limited support for converting from one time zone to another. You can use the DateTime.ToLocalTime method to convert UTC to local time, or you can use the DateTime.ToUniversalTime method to convert from local time to UTC. However, a full set of time zone conversion methods is available in the TimeZoneInfo class. Using these methods, you can convert the time in any one of the world's time zones to the time in any other time zone.

Calculations and comparisons of DateTime objects are meaningful only if the objects represent times in the same time zone. You can use a TimeZoneInfo object to represent a DateTime value's time zone, although the two are loosely coupled. (That is, a DateTime object does not have a property that returns an object that represents that date and time value's time zone other than the DateTime.Kind property.) For this reason, in a time zone-aware application, you must rely on some external mechanism to determine the time zone in which a DateTime object was created. For example, you could use a structure that wraps both the DateTime value and the TimeZoneInfo object that represents the DateTime value's time zone. For details on using UTC in calculations and comparisons with DateTime values, see Performing Arithmetic Operations with Dates and Times.

Each DateTime member implicitly uses the Gregorian calendar to perform its operation, with the exception of constructors that specify a calendar, and methods with a parameter derived from IFormatProvider, such as DateTimeFormatInfo, that implicitly specifies a calendar.

Operations by members of the DateTime type take into account details such as leap years and the number of days in a month.

Two other common operations with DateTime values involve converting a date and time value to or from its string representation. The process of converting a DateTime value to its string representation is a formatting operation; for more information about formatting, see DateTime values and their string representations. The process of converting the string representation of a date and time to a DateTime value is a parsing operation; for more information about parsing, see Converting strings to DateTime values.

DateTime vs. TimeSpan

The DateTime and TimeSpan value types differ in that a DateTime represents an instant in time whereas a TimeSpan represents a time interval. This means, for example, that you can subtract one instance of DateTime from another to obtain a TimeSpan object that represents the time interval between them. Or you could add a positive TimeSpan to the current DateTime to obtain a DateTime value that represents a future date.

You can add or subtract a time interval from a DateTime object. Time intervals can be negative or positive, can be expressed in units such as ticks or seconds, or can be expressed as a TimeSpan object.

COM interop considerations

A DateTime value that is transferred to a COM application, then is transferred back to a managed application, is said to round-trip. However, a DateTime value that specifies only a time does not round-trip as you might expect.

If you round-trip only a time, such as 3 P.M., the final date and time is December 30, 1899 C.E. at 3:00 P.M., instead of January, 1, 0001 C.E. at 3:00 P.M. This happens because the .NET Framework and COM assume a default date when only a time is specified. However, the COM system assumes a base date of December 30, 1899 C.E. while the .NET Framework assumes a base date of January, 1, 0001 C.E.

When only a time is passed from the .NET Framework to COM, special processing is performed that converts the time to the format used by COM. When only a time is passed from COM to the .NET Framework, no special processing is performed because that would corrupt legitimate dates and times on or before December 30, 1899. This also means if a date starts its round-trip from COM, the .NET Framework and COM preserve the date.

The behavior of the .NET Framework and COM means that if your application round-trips a DateTime that only specifies a time, your application must remember to modify or ignore the erroneous date from the final DateTime object.

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0

The members of System.DateTime are listed below.

See Also: ValueType

Public Constructors

Initializes a new instance of the DateTime structure to a specified number of ticks.

Initializes a new instance of the DateTime structure to a specified number of ticks and to Coordinated Universal Time (UTC) or local time.

Initializes a new instance of the DateTime structure to the specified year, month, and day.

Initializes a new instance of the DateTime structure to the specified year, month, and day for the specified calendar.

Initializes a new instance of the DateTime structure to the specified year, month, day, hour, minute, and second.

Initializes a new instance of the DateTime structure to the specified year, month, day, hour, minute, second, and Coordinated Universal Time (UTC) or local time.

Initializes a new instance of the DateTime structure to the specified year, month, day, hour, minute, and second for the specified calendar.

Initializes a new instance of the DateTime structure to the specified year, month, day, hour, minute, second, and millisecond.

Initializes a new instance of the DateTime structure to the specified year, month, day, hour, minute, second, millisecond, and Coordinated Universal Time (UTC) or local time.

Initializes a new instance of the DateTime structure to the specified year, month, day, hour, minute, second, and millisecond for the specified calendar.

Initializes a new instance of the DateTime structure to the specified year, month, day, hour, minute, second, millisecond, and Coordinated Universal Time (UTC) or local time for the specified calendar.

Public Fields

static readonly
MaxValueDateTime (12/31/9999 11:59:59 PM).

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

static readonly
MinValueDateTime (1/1/0001 12:00:00 AM).

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

Public Properties

[read-only]
DateDateTime.

Gets the date component of this instance.

[read-only]
DayInt32.

Gets the day of the month represented by this instance.

[read-only]
DayOfWeekDayOfWeek.

Gets the day of the week represented by this instance.

[read-only]
DayOfYearInt32.

Gets the day of the year represented by this instance.

[read-only]
HourInt32.

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

[read-only]
KindDateTimeKind.

Gets a value that indicates whether the time represented by this instance is based on local time, Coordinated Universal Time (UTC), or neither.

[read-only]
MillisecondInt32.

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

[read-only]
MinuteInt32.

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

[read-only]
MonthInt32.

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

[read-only]
static
NowDateTime.

Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.

[read-only]
SecondInt32.

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

[read-only]
TicksInt64.

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

[read-only]
TimeOfDayTimeSpan.

Gets the time of day for this instance.

[read-only]
static
TodayDateTime.

Gets the current date.

[read-only]
static
UtcNowDateTime.

Gets a DateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC).

[read-only]
YearInt32.

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

Public Methods

Add(TimeSpan) : DateTime

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

AddDays(Double) : DateTime

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

AddHours(Double) : DateTime

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

AddMilliseconds(Double) : DateTime

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

AddMinutes(Double) : DateTime

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

AddMonths(Int32) : DateTime

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

AddSeconds(Double) : DateTime

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

AddTicks(Int64) : DateTime

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

AddYears(Int32) : DateTime

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

static
Compare(DateTime, DateTime) : Int32

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.

CompareTo(DateTime) : Int32

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.

CompareTo(Object) : Int32

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.

static
DaysInMonth(Int32, Int32) : Int32

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

Equals(DateTime) : Boolean

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

override
Equals(Object) : Boolean

Returns a value indicating whether this instance is equal to a specified object.

static
Equals(DateTime, DateTime) : Boolean

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

static
FromBinary(Int64) : DateTime

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

static
FromFileTime(Int64) : DateTime

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

static
FromFileTimeUtc(Int64) : DateTime

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

static
FromOADate(Double) : DateTime

Returns a DateTime equivalent to the specified OLE Automation Date.

GetDateTimeFormats() : String[]

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

GetDateTimeFormats(Char) : String[]

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

GetDateTimeFormats(IFormatProvider) : String[]

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.

GetDateTimeFormats(Char, IFormatProvider) : String[]

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.

override
GetHashCode() : Int32

Returns the hash code for this instance.

GetTypeCode() : TypeCode

Returns the TypeCode for value type DateTime.

IsDaylightSavingTime() : Boolean

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

static
IsLeapYear(Int32) : Boolean

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

static
Parse(String) : DateTime

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

static
Parse(String, IFormatProvider) : DateTime

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

static
Parse(String, IFormatProvider, DateTimeStyles) : DateTime

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

static
ParseExact(String, String, IFormatProvider) : DateTime

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.

static
ParseExact(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 or an exception is thrown.

static
ParseExact(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 or an exception is thrown.

static
SpecifyKind(DateTime, DateTimeKind) : DateTime

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.

Subtract(DateTime) : TimeSpan

Subtracts the specified date and time from this instance.

Subtract(TimeSpan) : DateTime

Subtracts the specified duration from this instance.

ToBinary() : Int64

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

ToFileTime() : Int64

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

ToFileTimeUtc() : Int64

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

ToLocalTime() : DateTime

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

ToLongDateString() : String

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

ToLongTimeString() : String

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

ToOADate() : Double

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

ToShortDateString() : String

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

ToShortTimeString() : String

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

override
ToString() : String

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

ToString(IFormatProvider) : String

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

ToString(String) : String

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

ToString(String, IFormatProvider) : String

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

ToUniversalTime() : DateTime

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

static
TryParse(String, out DateTime) : Boolean
static
TryParse(String, IFormatProvider, DateTimeStyles, out DateTime) : Boolean
static
TryParseExact(String, String, IFormatProvider, DateTimeStyles, out DateTime) : Boolean
static
TryParseExact(String, String[], IFormatProvider, DateTimeStyles, out DateTime) : Boolean

Public Operators

static
Addition(DateTime, TimeSpan)

Adds a specified time interval to a specified date and time, yielding a new date and time.

static
Equality(DateTime, DateTime)

Determines whether two specified instances of DateTime are equal.

static
GreaterThan(DateTime, DateTime)

Determines whether one specified DateTime is later than another specified DateTime.

static
GreaterThanOrEqual(DateTime, DateTime)

Determines whether one specified DateTime represents a date and time that is the same as or later than another specified DateTime.

static
Inequality(DateTime, DateTime)

Determines whether two specified instances of DateTime are not equal.

static
LessThan(DateTime, DateTime)

Determines whether one specified DateTime is earlier than another specified DateTime.

static
LessThanOrEqual(DateTime, DateTime)

Determines whether one specified DateTime represents a date and time that is the same as or earlier than another specified DateTime.

static
Subtraction(DateTime, DateTime)

Subtracts a specified date and time from another specified date and time and returns a time interval.

static
Subtraction(DateTime, TimeSpan)

Subtracts a specified time interval from a specified date and time and returns a new date and time.

Explicitly Implemented Interface Members

DateTime$ISerializable.GetObjectData(SerializationInfo,StreamingContext)

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

DateTime$IConvertible.ToBoolean(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToByte(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToChar(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToDateTime(IFormatProvider)

Returns the current DateTime object.

DateTime$IConvertible.ToDecimal(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToDouble(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToInt16(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToInt32(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToInt64(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToSByte(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToSingle(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToType(Type,IFormatProvider)

Converts the current DateTime object to an object of a specified type.

DateTime$IConvertible.ToUInt16(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToUInt32(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

DateTime$IConvertible.ToUInt64(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.