mscorlib 2.0.0.0 4.0.0.0 System.ValueType System.IComparable System.IComparable<System.DateTimeOffset> System.IEquatable<System.DateTimeOffset> System.IFormattable System.Runtime.Serialization.IDeserializationCallback System.Runtime.Serialization.ISerializable

The structure includes a value, together with an property that defines the difference between the current instance's date and time and Coordinated Universal Time (UTC). Because it exactly defines a date and time relative to UTC, the structure does not include a Kind member, as the structure does. It represents dates and times with values whose UTC ranges from 12:00:00 midnight, January 1, 0001 Anno Domini (Common Era), to 11:59:59 P.M., December 31, 9999 A.D. (C.E.).

The time component of a value is 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 calendar. A value is always expressed in the context of an explicit or default calendar. Ticks that are attributable to leap seconds are not included in the total number of ticks.

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 , , , , or constant to perform the conversion. For example, to add the number of seconds represented by a specified number of ticks to the component of a value, you can use the expression dateValue.Second + nTicks/Timespan.TicksPerSecond.

Although a value includes an offset, it is not a fully time zone-aware data structure. While an offset from UTC is one characteristic of a time zone, it does not unambiguously identify a time zone. Not only do multiple time zones share the same offset from UTC, but the offset of a single time zone changes if it observes daylight saving time. This means that, as soon as a value is disassociated from its time zone, it can no longer be unambiguously linked back to its original time zone.

Because is a structure, a object that has been declared but not otherwise initialized contains the default values for each of its member fields. This means that its property is set to and its property is set to .

You can create a new value by calling any of the overloads of its constructor, which are similar to the overloaded constructors for the structure. You can also create a new value by assigning it a value. This is an implicit conversion; it does not require a casting operator (in C#) or call to a conversion method (in Visual Basic). You can also initialize a value from the string representation of a date and time by calling a number of static string parsing methods, which include , , , and .

The members of the structure provide functionality in the following areas:

Date and time arithmetic.

You can add or subtract either dates or time intervals from a particular value. Arithmetic operations with values, unlike those with values, adjust for differences in time offsets when returning a result. For example, the following code uses variables to subtract the current local time from the current UTC time. The code then uses variables to perform the same operation. The subtraction with values returns the local time zone's difference from UTC, while the subtraction with values returns .

code reference: System.DateTimeOffset.Type#1

Type conversion operations.

You can convert values to values and vice versa.

Time manipulation and extraction operations.

You can extract either the date or the time of a value. You can also retrieve the value of a particular component, such as its year or its month.

Date and time conversion.

You can convert any value to another value that represents the same point in time in another time zone. However, a time zone's adjustment rules are applied only in the case of the method, which converts a value to the date and time in the local system zone.

Date and time comparison.

You can determine whether any particular value is earlier than, the same as, or later than another value. Before the comparison is performed, all values are converted to UTC.

Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Universal Time (UTC).

- Constructor
  2.0.0.0
  4.0.0.0

  This constructor's behavior depends on the value of the property of the parameter:

  If the value of is , the property of the new instance is set equal to , and the property is set equal to .

  If the value of is or , the property of the new instance is set equal to , and the property is set equal to the offset of the local system's current time zone.

  Initializes a new instance of the structure using the specified value.

  A date and time.
- Constructor
  2.0.0.0
  4.0.0.0

  This constructor's behavior depends in part on the value of the property of the parameter:

  If the value of is , the value of the parameter must be 0 or an is thrown.

  If the value of is , the value of the parameter must be equal to the local time zone's offset from Coordinated Universal Time (UTC) for that particular date or an is thrown.

  If the value of is , the parameter can have any valid value.

  Initializes a new instance of the structure using the specified value and offset.

  A date and time.
  The time's offset from Coordinated Universal Time (UTC).
- Constructor
  2.0.0.0
  4.0.0.0

  Ordinarily, trying to call the constructor to instantiate a value with a local time and an offset other than that of the local time zone throws an . You can use this overload of the constructor to work around this limitation. The following example uses the local time's number of ticks to instantiate a value whose offset does not necessarily represent that of the local time:

  code reference: System.DateTimeOffset.Constructors#4

  Initializes a new instance of the structure using the specified number of ticks and offset.

  A date and time expressed as the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight on January 1, 0001.
  The time's offset from Coordinated Universal Time (UTC).
- Constructor
  2.0.0.0
  4.0.0.0

  This constructor interprets , , and as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor.

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

  The year (1 through 9999).
  The month (1 through 12).
  The day (1 through the number of days in ).
  The hours (0 through 23).
  The minutes (0 through 59).
  The seconds (0 through 59).
  The time's offset from Coordinated Universal Time (UTC).
- Constructor
  2.0.0.0
  4.0.0.0

  This constructor interprets , , and as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor.

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

  The year (1 through 9999).
  The month (1 through 12).
  The day (1 through the number of days in ).
  The hours (0 through 23).
  The minutes (0 through 59).
  The seconds (0 through 59).
  The milliseconds (0 through 999).
  The time's offset from Coordinated Universal Time (UTC).
- Constructor
  2.0.0.0
  4.0.0.0

  The , , , , , , and parameters all reflect values expressed in the calendar specified by the parameter. An exception is thrown if these values form a date and time that cannot be expressed by using this calendar.

  Initializes a new instance of the structure using the specified year, month, day, hour, minute, second, millisecond, and offset of a specified calendar.

  The year.
  The month (1 through 12).
  The day (1 through the number of days in ).
  The hours (0 through 23).
  The minutes (0 through 59).
  The seconds (0 through 59).
  The milliseconds (0 through 999).
  The calendar that is used to interpret , , and .
  The time's offset from Coordinated Universal Time (UTC).
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  You can use the method to add more than one kind of time interval (days, hours, minutes, seconds, or milliseconds) in a single operation. This method's behavior is identical to the addition operator. The structure also supports specialized addition methods (such as , , and ) for each time interval.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  The method does not affect the value of the current object's property.

  Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.

  If the parameter is null, this method returns the value of the original object unchanged.

  Adds a specified time interval to a object.

  An object whose value is the sum of the date and time represented by the current object and the time interval represented by .

  A object that represents a positive or a negative time interval.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  The fractional part of the parameter is the fractional part of a day. For example, 4.5 is equivalent to 4 days, 12 hours, 0 minutes, 0 seconds, 0 milliseconds. The parameter is rounded to the nearest millisecond.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.

  Converting time intervals of less than a day to a fraction can involve a loss of precision. If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of a day.

  Adds a specified number of whole and fractional days to the current object.

  An object whose value is the sum of the date and time represented by the current object and the number of days represented by .

  A number of whole and fractional days. The number can be negative or positive.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  The fractional part of the parameter is the fractional part of an hour. For example, 4.5 is equivalent to 4 hours, 30 minutes, 0 seconds, 0 milliseconds. The parameter is rounded to the nearest millisecond.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.

  Converting time intervals of less than an hour to a fraction can involve a loss of precision. (For example, one minute is 0.01666 of an hour.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of an hour.

  Adds a specified number of whole and fractional hours to the current object.

  An object whose value is the sum of the date and time represented by the current object and the number of hours represented by .

  A number of whole and fractional hours. The number can be negative or positive.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  The fractional part of the parameter is the fractional part of a millisecond. For example, 4.5 is equivalent to 4 milliseconds and 5000 ticks, where one millisecond equals 10,000 ticks. However, is rounded to the nearest millisecond; all values of .5 or greater are rounded up.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.

  Adds a specified number of milliseconds to the current object.

  An object whose value is the sum of the date and time represented by the current object and the number of whole milliseconds represented by .

  A number of whole and fractional milliseconds. The number can be negative or positive.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  The fractional part of the parameter is the fractional part of a minute. For example, 4.5 is equivalent to 4 minutes, 30 seconds, 0 milliseconds. The parameter is rounded to the nearest millisecond.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.

  Converting time intervals of less than a minute to a fraction can involve a loss of precision. (For example, one second is 0.01666 of a minute.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of a minute.

  Adds a specified number of whole and fractional minutes to the current object.

  An object whose value is the sum of the date and time represented by the current object and the number of minutes represented by .

  A number of whole and fractional minutes. The number can be negative or positive.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  Unlike most of the other methods that add a single time interval unit (such as minutes or days) to a date and time value, does not enable you to add fractional parts of a month. To add a time that consists of other time units in addition to months to a object, use the method.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  Adds a specified number of months to the current object.

  An object whose value is the sum of the date and time represented by the current object and the number of months represented by .

  A number of whole months. The number can be negative or positive.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  The fractional part of the parameter is the fractional part of a second. The value of fractional parts of a second are shown in the following table.

  Second value

  Equivalent

  .1 second

  100 milliseconds

  .01 second

  10 milliseconds

  .001 second

  1 millisecond

  The parameter is rounded to the nearest millisecond.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.

  Adds a specified number of whole and fractional seconds to the current object.

  An object whose value is the sum of the date and time represented by the current object and the number of seconds represented by .

  A number of whole and fractional seconds. The number can be negative or positive.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  A tick represents 100 nanoseconds, or one-ten millionth of a second. Because a tick is a very small and precise time interval, any larger time unit can be expressed as a number of ticks without a loss of precision.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  The following table lists the number of ticks in a particular time interval.

  Time interval

  Number of ticks

  Second

  10,000,000

  Minute

  600,000,000

  Hour

  36,000,000,000

  Day

  864,000,000,000

  Week

  6,048,000,000,000

  Month

  Depends on number of days in the month.

  Non-leap year

  315,360,000,000,000

  Leap year

  316,224,000,000,000

  Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.

  Adds a specified number of ticks to the current object.

  An object whose value is the sum of the date and time represented by the current object and the number of ticks represented by .

  A number of 100-nanosecond ticks. The number can be negative or positive.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  Unlike most of the other methods that add a single time interval unit (such as minutes or days) to a date and time value, does not enable you to add fractional parts of a year. To add a time that consists of other time units in addition to years to a object, use the method.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  Adds a specified number of years to the object.

  An object whose value is the sum of the date and time represented by the current object and the number of years represented by .

  A number of years. The number can be negative or positive.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  In performing the comparison, the method converts both the and the parameters to Coordinated Universal Time (UTC) before it performs the comparison. The method is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#1

  In other words, the method determines whether two objects represent a single point in time. It directly compares neither dates and times nor offsets.

  Compares two objects and indicates whether the first is earlier than the second, equal to the second, or later than the second.

  A signed integer that indicates whether the value of the parameter is earlier than, later than, or the same time as the value of the parameter, as the following table shows.

  Return value

  Meaning

  Less than zero

  is earlier than .

  Zero

  is equal to .

  Greater than zero

  is later than .

  The first object to compare. The second object to compare.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method compares objects by comparing their values; that is, it determines whether the two objects represent a single point in time, and indicates whether the current object is earlier than, later than, or the same as the parameter.

  Compares the current object to a specified object and indicates whether the current object is earlier than, the same as, or later than the second object.

  A signed integer that indicates the relationship between the current object and , as the following table shows.

  Return Value

  Description

  Less than zero

  The current object is earlier than .

  Zero

  The current object is the same as .

  Greater than zero.

  The current object is later than .

  An object to compare with the current object.
- Property
  2.0.0.0
  4.0.0.0
  System.DateTime To be added.

  This property removes any significant part of the time component from a object and returns only its significant date component. For example, if the object has a date and time value of "1/12/07 4:01pm +7:30", the property returns a value of "1/12/07 12:00:00 AM". The value can then be displayed by using any of the standard or custom format specifiers that display dates only. (See the Example section for an illustration.)

  The value of the property of the returned object is always . It is not affected by the value of the property.

  To display a date without its time component, you can also use the "D" or "d" format specifiers; for an illustration, see the Example section.

  Gets a value that represents the date component of the current object.

- Property
  2.0.0.0
  4.0.0.0
  System.DateTime To be added.

  The property is not affected by the value of the property.

  This property returns both the date and the time component of a object, which makes it useful for performing to conversion. For example, if the object has a date and time value of "1/12/07 4:01pm + 7:30", the property returns a date of "1/12/07 4:01pm".

  The value of the property of the returned object is .

  Gets a value that represents the date and time of the current object.

- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  The property is not affected by the value of the property.

  You can also create a string representation of a object's day component by calling the method with the "d" or "dd" custom format specifiers.

  Gets the day of the month represented by the current object.

- Property
  2.0.0.0
  4.0.0.0
  System.DayOfWeek To be added.

  The value of the constants in the enumeration ranges from to . If cast to an integer, its value ranges from zero (which indicates ) to six (which indicates ).

  You can also display the weekday name of a particular date by using the "D" format specifier or the "dddd" custom format specifier. For example:

  code reference: System.DateTimeOffset.Properties#4

  Note that the string returned by calling the ToString method of the enumeration member that is returned by this property is not localized. To extract a string that contains the weekday name of the current culture or of a specific culture, call the method with the "dddd" custom format specifier. For example, the following code displays the weekday name for a date using the fr-fr culture.

  code reference: System.DateTimeOffset.Properties#5

  Gets the day of the week represented by the current object.

- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added. To be added.

  Gets the day of the year represented by the current object.

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  Before it performs the comparison, this method converts the values of both objects to Coordinated Universal Time (UTC). The method is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#2

  In other words, the method determines whether two objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method.

  A object that is not null is considered to be later (or greater) than one that is null.

  This overload of the method implements the method. It offers slightly better performance than the overload because the parameter does not have to be converted from an object.

  Determines whether the current object represents the same point in time as a specified object.

  true if both objects have the same value; otherwise, false.

  An object to compare to the current object.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  Before it performs the comparison, this method converts the values of both the current object and the parameter to Coordinated Universal Time (UTC). The method is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#3

  In other words, the method determines whether the current object and a specified object represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method.

  If is null, or if the run-time type of is not , the method returns false.

  Determines whether a object represents the same point in time as a specified object.

  true if the parameter is a object and represents the same point in time as the current object; otherwise, false.

  The object to compare to the current object.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  Before it performs the comparison, this method converts both objects to Coordinated Universal Time (UTC). The method is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#4

  In other words, the method determines whether the two objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method.

  Determines whether two specified objects represent the same point in time.

  true if the two objects have the same value; otherwise, false.

  The first object to compare. The second object to compare.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  Because multiple time zones share a single offset, a return value of true does not guarantee that the current and the object represent times in the same time zone.

  Unlike the method, the overloads of the method determine only whether two values represent a single point in time. They do not indicate that two values have the same date and time as well as the same offset.

  Determines whether the current object represents the same time and has the same offset as a specified object.

  true if the current object and have the same date and time value and the same value; otherwise, false.

  The object to compare to the current object.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  A Windows file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC). Windows uses a file time to record when an application creates, accesses, or writes to a file.

  A Windows file time is directly accessible through the Windows API by calling the GetFileTime function, which returns a FILETIME structure. The single function parameter is the handle of the file whose file time information is to be retrieved. The file handle is retrieved by calling the CreateFile function. The FILETIME structure's dwHighDateTime member contains the four high-order bytes of the file time, and its dwLowDateTime member contains the four low-order bytes. The example that follows illustrates how to retrieve Windows file time values and convert them to values.

  Windows file time values can also be created from values by calling the and methods, and from values by calling the method.

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

  An object that represents the date and time of with the offset set to the local time offset.

  A Windows file time, expressed in ticks.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  Returns the hash code for the current object.

  A 32-bit signed integer hash code.

- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  The property is not affected by the value of the property.

  You can also create a string representation of a object's hour component by calling the method with the "H", or "HH" custom format specifiers.

  Gets the hour component of the time represented by the current object.

- Property
  2.0.0.0
  4.0.0.0
  System.DateTime To be added.

  If necessary, the property converts the current object's date and time to the local system's date and time. The conversion is a two-step operation:

  The property converts the current object's time to Coordinated Universal Time (UTC).

  The property then converts UTC to local time.

  There are no invalid times and ambiguous times are mapped to the local zone's standard time. (However, the conversion can create an anomaly: if a value that is derived from the local computer reflects an ambiguous date and time, that value can be converted to UTC and then back to a local time that differs from the original time.) The property applies any adjustment rules in the local time zone when it performs this conversion.

  This property returns both the date and the time component of a object, which makes it useful for to conversion. In addition to performing any necessary time conversion, this property differs from the property by setting the value of the property of the returned object to .

  Gets a value that represents the local date and time of the current object.

- Field
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset 12/31/9999 11:59:59 PM +00:00

  The value of this constant is 12/31/9999 11:59:59 PM +00:00.

  The property is used to determine whether the value of a new object or the value returned by an arithmetic operation is the same as or earlier than this maximum range value. If it is not, the method throws an . Any value is converted to Coordinated Universal Time (UTC) before the method compares it with . This means that a value whose date and time are close to the maximum range, but whose offset is negative, may throw an exception. For example, the value 12/31/9999 11:00 PM -02:00 is out of range because it is one hour later than when it is converted to UTC.

  Some calendars, such as the , support an upper date range that is earlier than . In these cases, trying to access in variable assignments or formatting and parsing operations can throw an . Instead of retrieving the value of , you can retrieve the value of the specified culture's latest valid date value from the property.

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

- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  You can also create a string representation of a object's millisecond component by calling the method with the "fff" custom format specifier.

  If you rely on properties such as or to accurately track the number of elapsed milliseconds, the precision of the time's millisecond component depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

  Gets the millisecond component of the time represented by the current object.

- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  The property is not affected by the value of the property.

  You can also create a string representation of a object's minute component by calling the method with the "m", or "mm" custom format specifiers.

  Gets the minute component of the time represented by the current object.

- Field
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset 1/1/0001 12:00:00 AM +00:00

  The value of this constant is 1/1/0001 12:00:00 AM +00:00.

  The property is used to determine whether the value of a new object or the value returned by an arithmetic operation is the same as or later than this minimum range value. If it is not, the method throws an . Any value is converted to Coordinated Universal Time (UTC) before the method performs the comparison with . This means that a value whose date and time are close to the minimum range, but whose offset is positive, may throw an exception. For example, the value 1/1/0001 1:00:00 AM +02:00 is out of range because it is one hour earlier than when it is converted to UTC.

  Represents the earliest possible value. This field is read-only.

- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  The property is not affected by the value of the property.

  You can also create a string representation of a object's month component by calling the method with the "M" or "MM" custom format specifiers.

  Gets the month component of the date represented by the current object.

- Property
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset To be added.

  The precision of the current local time's millisecond component depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

  Gets a object that is set to the current date and time on the current computer, with the offset set to the local time's offset from Coordinated Universal Time (UTC).

- Property
  2.0.0.0
  4.0.0.0
  System.TimeSpan To be added.

  The value of the property of the returned object can range from -14 hours to 14 hours.

  The value of the property is precise to the minute.

  Gets the time's offset from Coordinated Universal Time (UTC).

- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset `` ``

  The method defines the addition operation for values. It enables code such as the following:

  code reference: System.DateTimeOffset.Operators#1

  Languages that do not support custom operators and operator overloading can call the method instead.

  Adds a specified time interval to a object that has a specified date and time, and yields a object that has new a date and time.

  An object whose value is the sum of the values of and .

  The object to add the time interval to. The time interval to add.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the equality operator for objects. It enables code such as the following:

  code reference: System.DateTimeOffset.Operators#2

  Before evaluating the and operands for equality, the operator converts both values to Coordinated Universal Time (UTC). The operation is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#4

  In other words, the method determines whether the two objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method.

  Determines whether two specified objects represent the same point in time.

  true if both objects have the same value; otherwise, false.

  The first object to compare. The second object to compare.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than operator for objects. It enables code such as the following:

  code reference: System.DateTimeOffset.Operators#3

  Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows.

  code reference: System.DateTimeOffset.Operators#4

  Before evaluating the and operands, the operator converts both values to Coordinated Universal Time (UTC). The operation is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#5

  Determines whether one specified object is greater than (or later than) a second specified object.

  true if the value of is later than the value of ; otherwise, false.

  The first object to compare. The second object to compare.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than or equal to operator for objects. It enables code such as the following:

  code reference: System.DateTimeOffset.Operators#5

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.DateTimeOffset.Operators#6

  Before evaluating the and operands, the operator converts both values to Coordinated Universal Time (UTC). The operation is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#6

  Determines whether one specified object is greater than or equal to a second specified object.

  true if the value of is the same as or later than the value of ; otherwise, false.

  The first object to compare. The second object to compare.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset `` To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the inequality operator for objects. It always returns the opposite result from . The method enables code such as the following:

  code reference: System.DateTimeOffset.Operators#8

  Before evaluating the and operands for equality, the operator converts both values to Coordinated Universal Time (UTC). The operation is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#4

  In other words, the method determines whether the two objects represent different points in time. It directly compares neither dates and times nor offsets.

  Languages that do not support custom operators can call the method instead. In addition, some languages can also call the method directly, as the following example shows.

  code reference: System.DateTimeOffset.Operators#9

  Determines whether two specified objects refer to different points in time.

  true if and do not have the same value; otherwise, false.

  The first object to compare. The second object to compare.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than operator for objects. It enables code such as the following:

  code reference: System.DateTimeOffset.Operators#10

  Before evaluating the and operands, the operator converts both operands to Coordinated Universal Time (UTC). The operation is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#8

  Languages that do not support custom operators can call the method instead. In addition, some languages can also call the method directly, as the following example shows.

  code reference: System.DateTimeOffset.Operators#11

  Determines whether one specified object is less than a second specified object.

  true if the value of is earlier than the value of ; otherwise, false.

  The first object to compare. The second object to compare.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than or equal to operator for objects. It enables code such as the following:

  code reference: System.DateTimeOffset.Operators#12

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.DateTimeOffset.Operators#13

  Before evaluating the and operands, the operator converts both values to Coordinated Universal Time (UTC). The operation is equivalent to the following:

  code reference: System.DateTimeOffset.Syntax#9

  Determines whether one specified object is less than a second specified object.

  true if the value of is earlier than the value of ; otherwise, false.

  The first object to compare. The second object to compare.
- Method
  2.0.0.0
  4.0.0.0
  System.TimeSpan `` ``

  The method defines the subtraction operation for objects. It enables code such as the following:

  code reference: System.DateTimeOffset.Operators#14

  Languages that do not support custom operators and operator overloading can call the method instead.

  Subtracts one object from another and yields a time interval.

  An object that represents the difference between and .

  The minuend. The subtrahend.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset `` ``

  The method defines the subtraction operation for objects. It enables code such as the following:

  code reference: System.DateTimeOffset.Operators#15

  Languages that do not support custom operators and operator overloading can call the method instead.

  Subtracts a specified time interval from a specified date and time, and yields a new date and time.

  An object that is equal to the value of minus .

  The date and time object to subtract from. The time interval to subtract.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  parses a string with three elements that can appear in any order and are delimited by white space. These three elements are as shown in the following table.

  Element

  Example

  <Date>

  "2/10/2007"

  <Time>

  "1:02:03 PM"

  <Offset>

  "-7:30:15"

  Although each of these elements is optional, <Offset> cannot appear by itself. It must be provided together with either <Date> or <Time>. If <Date> is missing, its default value is the current day. If <Time> is missing, its default value is 12:00:00 AM. If <Date> is present but its year component consists of only two digits, it is converted to a year in the current culture's current calendar based on the value of the property. If <Offset> is missing, its default value is the offset of the local time zone. <Offset> can represent either a negative or a positive offset from Coordinated Universal Time (UTC). In either case, <Offset> must include a sign symbol.

  The string is parsed by using the formatting information in a object that is initialized for the current culture. To parse a string that contains designated formatting that does not necessarily correspond to the formatting of the current culture, use the method and provide a format specifier.

  Converts the specified string representation of a date, time, and offset to its equivalent.

  An object that is equivalent to the date and time that is contained in .

  A string that contains a date and time to convert.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset `` ``

  This method parses a string with three elements that can appear in any order and are delimited by white space. These three elements are shown in the following table.

  Element

  Example

  <Date>

  "2/10/2007"

  <Time>

  "1:02:03 PM"

  <Offset>

  "-7:30:15"

  Although each of these elements is optional, <Offset> cannot appear by itself. It must be provided together with either <Date> or <Time>. If <Date> is missing, its default value is the current day. If <Date> is present but its year component consists of only two digits, it is converted to a year in the parameter's current calendar based on the value of the property. If <Time> is missing, its default value is 12:00:00 AM. If <Offset> is missing, its default value is the offset of the local time zone. <Offset> can represent either a negative or a positive offset from Coordinated Universal Time (UTC). In either case, <Offset> must include a sign symbol.

  The format of these three elements is defined by the parameter, which can be either of the following:

  A object that represents the culture whose formatting is used in the parameter. The object returned by the property defines the formatting used in .

  A object that defines the format of date and time data.

  If is null, the object that corresponds to the current culture is used.

  The positive or negative sign used in <Offset> must be either + or -. It is not defined by the or properties of the object of the parameter.

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

  An object that is equivalent to the date and time that is contained in , as specified by .

  A string that contains a date and time to convert. An object that provides culture-specific format information about .
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset `` `` ``

  This method parses a string with three elements that can appear in any order and are delimited by white space. These three elements are shown in the following table.

  Element

  Example

  <Date>

  "2/10/2007"

  <Time>

  "1:02:03 PM"

  <Offset>

  "-7:30:15"

  Although each of these elements is optional, <Offset> cannot appear by itself. It must be provided together with either <Date> or <Time>. If <Date> is missing, its default value is the current day. If <Date> is present but its year component consists of only two digits, it is converted to a year in the parameter's current calendar based on the value of the property. If <Time> is missing, its default value is 12:00:00 AM. If <Offset> is missing, its default value is the offset of the local time zone, or if either the or value is specified in the parameter. If <Offset> is present, it can represent either a negative or a positive offset from Coordinated Universal Time (UTC). In either case, <Offset> must include a sign symbol.

  The format of these three elements is defined by the parameter, which can be either of the following:

  A object that represents the culture whose formatting is used in the parameter. The object returned by the property defines the formatting used in .

  A object that defines the format of date and time data.

  Each element can also be enclosed by leading or trailing white space, and the <Date> and <Time> elements can include inner white space (such as 6: 00:00). Only the <Offset> component cannot include inner white space.

  If is null, the object that corresponds to the current culture is used.

  The positive or negative sign used in <Offset> must be either + or -. It is not defined by the or properties of the object returned by the parameter.

  The following table shows the members of the enumeration that are supported.

  DateTimeStyles member

  Description

  Parses the string represented by and, if necessary, converts it to UTC. It is equivalent to parsing a string and then calling the method of the returned object.

  Although valid, this value is ignored. Inner white space is permitted in the <Date> and <Time> elements.

  Although valid, this value is ignored. Leading white space is permitted in front of each component in the parsed string.

  Although valid, this value is ignored. Trailing white space is permitted in front of each component in the parsed string.

  This is the default behavior. It cannot be overridden by supplying a more restrictive enumeration value, such as .

  Indicates that, if the parameter lacks an <Offset> element, the offset of the local time zone should be provided. This is the default behavior of the method.

  Indicates that, if the parameter lacks an <Offset> element, the UTC offset (00:00) should be provided.

  Although valid, this value is ignored and has no effect.

  Because the structure does not include a Kind property, this value has no effect.

  Only the value is not supported. An is thrown if this value is included in the parameter.

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

  An object that is equivalent to the date and time that is contained in as specified by and .

  A string that contains a date and time to convert. An object that provides culture-specific format information about . A bitwise combination of enumeration values that indicates the permitted format of . A typical value to specify is .
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset `` `` ``

  The method parses the string representation of a date, which must be in the format defined by the parameter. It also requires that the <Date>, <Time>, and <Offset> elements of the string representation of a date and time appear in the order specified by . If the string does not match this parameter, the method throws a . In contrast, the method parses the string representation of a date in any one of the formats recognized by the format provider's object. also allows the <Date>, <Time>, and <Offset> elements of the string representation of a date and time to appear in any order.

  The parameter is a string that contains either a single standard format specifier or one or more custom format specifiers that define the required format of the parameter. For details about valid formatting codes, see Standard DateTime Format Strings and Custom DateTime Format Strings. If includes the z, zz, or zzz custom format specifiers to indicate that an offset must be present in , that offset must include either a negative sign or a positive sign. If the sign is missing, the method throws a .

  If requires that contain a date but not a time, the resulting object is assigned a time of midnight (0:00:00). If requires that contain a time but not a date, the resulting object is assigned the current date on the local system. If does not require that contain an offset, the resulting object is assigned the time zone offset of the local system.

  The particular date and time symbols and strings used in are defined by the parameter, as is the precise format of if is a standard format specifier string. The parameter can be either of the following:

  A object that represents the culture based on which is interpreted. The object returned by its property defines the symbols and formatting in .

  A object that defines the format of date and time data.

  If is null, the object that corresponds to the current culture is used.

  Converts the specified string representation of a date and time to its equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

  An object that is equivalent to the date and time that is contained in as specified by and .

  A string that contains a date and time to convert. A format specifier that defines the expected format of . An object that supplies culture-specific formatting information about .
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset `` `` `` ``

  The method parses the string representation of a date, which must be in the format defined by the parameter. It also requires that the <Date>, <Time>, and <Offset> elements of the string representation of a date and time appear in the order specified by . If the string does not match the pattern of the parameter, with any variations defined by the parameter, the method throws a . In contrast, the method parses the string representation of a date in any one of the formats recognized by the format provider's object. also allows the <Date>, <Time>, and <Offset> elements of the string representation of a date and time to appear in any order.

  The parameter is a string that contains either a single standard format specifier or one or more custom format specifiers that define the required pattern of the parameter. For details about valid formatting codes, see Standard DateTime Format Strings and Custom DateTime Format Strings. If includes the z, zz, or zzz custom format specifiers to indicate that an offset must be present in , that offset must include either a negative sign or a positive sign. If the sign is missing, the method throws a .

  If requires that contain a date but not a time, the resulting object is assigned a time of midnight (0:00:00). If requires that contain a time but not a date, the resulting object is assigned the current date on the local system. If does not require that contain an offset, the offset of the resulting object depends on the value of the parameter. If includes , the offset of the local time zone is assigned to the object. If includes , the Coordinated Universal Time (UTC) offset, or +00:00, is assigned to the object. If neither value is specified, the offset of the local time zone is used.

  The particular date and time symbols and strings used in are defined by the parameter. The same is true for the precise format of , if is a standard format specifier string. The parameter can be either of the following:

  A object that represents the culture based on which is interpreted. The object returned by the property defines the symbols and formatting in .

  A object that defines the format of date and time data.

  If is null, the object that corresponds to the current culture is used.

  The parameter defines whether white space is allowed in the input string, indicates how strings without an explicit offset component are parsed, and supports UTC conversion as part of the parsing operation. All members of the enumeration are supported except . The following table lists the effect of each supported member.

  DateTimeStyles member

  Behavior

  Parses and, if necessary, converts it to UTC. It is equivalent to parsing a string, and then calling the method of the returned object.

  If does not require that contain an offset value, the returned object is given the offset of the local time zone. This is the default value.

  If does not require that contain an offset value, the returned object is given the UTC offset (+00:00).

  Allows to include inner white space not specified by . Extra white space can appear between date and time components and within individual components, and is ignored when parsing the string.

  Allows to include leading spaces not specified by . These are ignored when parsing the string.

  Allows to include trailing spaces not specified by . These are ignored when parsing the string.

  Allows to include leading, trailing, and inner spaces not specified by . All extra white-space characters not specified in are ignored when parsing the string.

  Indicates that additional white space is not permitted in . White space must appear exactly as specified in . This is the default behavior.

  Has no effect because the structure does not include a Kind property.

  Converts the specified string representation of a date and time to its equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly.

  An object that is equivalent to the date and time that is contained in the parameter, as specified by the , , and parameters.

  A string that contains a date and time to convert. A format specifier that defines the expected format of . An object that supplies culture-specific formatting information about . A bitwise combination of enumeration values that indicates the permitted format of .
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset `` `` `` ``

  The method parses the string representation of a date that matches any one of the patterns assigned to the parameter. If the string does not match any one of these patterns with any of the variations defined by the parameter, the method throws a . Aside from comparing to multiple formatting patterns, this overload behaves identically to the method.

  The parameter is a string array whose elements contain either a single standard format specifier or one or more custom format specifiers that define the possible pattern of the parameter. When the method is called, must match one of these patterns. For details about valid formatting codes, see Standard DateTime Format Strings and Custom DateTime Format Strings. If the matched element in includes the z, zz, or zzz custom format specifiers to indicate that an offset must be present in , that offset must include either a negative sign or a positive sign. If the sign is missing, the method throws a .

  Using the parameter of this overload to specify multiple formats can help reduce the frustration many users experience when they enter dates and times. In particular, the ability to define multiple input patterns enables an application to handle date and time representations that can either include or lack leading zeros in months, days, hours, minutes, and seconds. The example provides an illustration of this.

  If the matched element in requires that contain a date but not a time, the resulting object is assigned a time of midnight (0:00:00). If the matched element in requires that contain a time but not a date, the resulting object is assigned the current date on the local system. If the matched element in does not require that contain an offset, the offset of the resulting object depends on the value of the parameter. If includes , the offset of the local time zone is assigned to the object. If includes , the Coordinated Universal Time (UTC) offset, or +00:00, is assigned to the object. If neither value is specified, the offset of the local time zone is used.

  The particular date and time symbols and strings used in are defined by the parameter. The same is true for the precise format of , if the matching element of is a standard format specifier string. The parameter can be either of the following:

  A object that represents the culture based on which is interpreted. The object returned by the property defines the symbols and formatting in .

  A object that defines the format of date and time data.

  If is null, the object that corresponds to the current culture is used.

  The parameter defines whether white space is permitted in the input string, indicates how strings without an explicit offset component are parsed, and supports UTC conversion as part of the parsing operation. All members of the enumeration are supported except . The following table lists the effect of each supported member.

  DateTimeStyles member

  Behavior

  Parses and, if necessary, converts it to UTC. It is equivalent to parsing a string, and then calling the method of the returned object.

  If the matched element in does not require that contain an offset value, the returned object is given the offset of the local time zone. This is the default value.

  If the matched element in does not require that contain an offset value, the returned object is given the UTC offset (+00:00).

  Allows to include inner white space not specified by . Extra white space can appear between date and time components and within individual components (except the offset), and is ignored when parsing the string.

  Allows to include leading spaces not specified by . These are ignored when parsing the string.

  Allows to include trailing spaces not specified by . These are ignored when parsing the string.

  Allows to include leading, trailing, and inner spaces not specified by . All extra white-space characters not specified in the matched element in are ignored when parsing the string.

  Indicates that additional white space is not permitted in . White space must appear exactly as specified in a particular element of for a match to occur. This is the default behavior.

  Has no effect because the structure does not include a Kind property.

  Converts the specified string representation of a date and time to its equivalent using the specified formats, culture-specific format information, and style. The format of the string representation must match one of the specified formats exactly.

  An object that is equivalent to the date and time that is contained in the parameter, as specified by the , , and parameters.

  A string that contains a date and time to convert. An array of format specifiers that define the expected formats of . An object that supplies culture-specific formatting information about . A bitwise combination of enumeration values that indicates the permitted format of .
- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  The property is not affected by the value of the property.

  You can also create a string representation of a object's second component by calling the method with the "s", or "ss" custom format specifiers.

  Gets the second component of the clock time represented by the current object.

- Method
  2.0.0.0
  4.0.0.0
  System.TimeSpan ``

  This method converts both objects to Coordinated Universal Time (UTC) before calculating the time interval that separates them. This removes any effect that different offsets from UTC may have on the comparison.

  For languages that support custom operators, you can also perform date and time subtraction by using the subtraction operator. For details, see the method.

  Because neither the current object nor the parameter represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it subtracts dates and times.

  Subtracts a value that represents a specific date and time from the current object.

  An object that specifies the interval between the two objects.

  An object that represents the value to subtract.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  You can use the method to subtract more than one kind of time interval (days, hours, minutes, seconds, or milliseconds) in a single operation. Its behavior is identical to the method, which defines the subtraction operator. The structure also supports specialized addition methods (such as , , and ) that allow you to perform subtraction by assigning a negative value to the method parameter.

  This method returns a new object. It does not modify the value of the current object by adding to its date and time.

  The method does not affect the value of the object's property. The returned object has the same offset as the original object.

  Because the current object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs the subtraction.

  Subtracts a specified time interval from the current object.

  An object that is equal to the date and time represented by the current object, minus the time interval represented by .

  The time interval to subtract.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Compares the value of the current object with another object of the same type.

  A 32-bit signed integer that indicates whether the current object is less than, equal to, or greater than . The return values of the method are interpreted as follows:

  Return Value

  Description

  Less than zero

  The current object is less than (earlier than) .

  Zero

  The current object is equal to (the same point in time as) .

  Greater than zero

  The current object is greater than (later than) .

  The object to compare with the current object.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` To be added.

  Runs when the deserialization of an object has been completed.

  The object that initiated the callback. The functionality for this parameter is not currently implemented.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added.

  Populates a object with the data required to serialize the current object.

  The object to populate with data. The destination for this serialization (see ).
- Property
  2.0.0.0
  4.0.0.0
  System.Int64 To be added.

  The property is not affected by the value of the property.

  The value of the property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight on January 1, 0001 (the value of ). It does not include ticks that would be added by leap seconds. A nanosecond is one billionth of a second; there are ten million ticks in a second. The value of the property ranges from DateTimeOffset.MinValue.Ticks to DateTimeOffset.MaxValue.Ticks.

  You can assign the number of ticks to a object by using the constructor overload.

  Gets the number of ticks that represents the date and time of the current object in clock time.

- Property
  2.0.0.0
  4.0.0.0
  System.TimeSpan To be added.

  The property is not affected by the value of the property.

  The property returns the time component of a object in the form of a object. It is equivalent to the property.

  Gets the time of day for the current object.

- Method
  2.0.0.0
  4.0.0.0
  System.Int64

  A Windows file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC). Windows uses a file time to record when an application creates, accesses, or writes to a file.

  The method converts the current object's date and time to UTC before it performs the conversion. In other words, calling the method is equivalent to the following method call:

  [C#]

  `this.ToUtcDateTime().ToFileTime();`

  [Visual Basic]

  `Me.ToUtcDateTime().ToFileTime()`

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

  The value of the current object, expressed as a Windows file time.

- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset

  In performing the conversion to local time, the method first converts the current object's date and time to Coordinated Universal Time (UTC) by subtracting the offset from the time. It then converts the UTC date and time to local time by adding the local time zone offset. In doing this, it takes account of any adjustment rules for the local time zone.

  Both the value of the current object and the value of the object returned by the method call represent the same point in time. That is, if both are passed to the method, the method will return true.

  If the conversion causes a time that is out of range of the type, the method returns a object that has the date and time set to either or and the offset set to the local time zone offset.

  Converts the current object to a object that represents the local time.

  An object that represents the date and time of the current object converted to local time.

- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset ``

  The method is an alternative to calling the method. It can be useful for performing simple conversions from one time zone to another when the time zones' offsets from Coordinated Universal Time (UTC) are known. However, because neither the original object nor the new object returned by the method call are unambiguously related to a particular time zone, the method does not apply any time zone adjustment rules in the conversion.

  Converts the value of the current object to the date and time specified by an offset value.

  An object that is equal to the original object (that is, their methods return identical points in time) but whose property is set to .

  The offset to convert the value to.
- Method
  2.0.0.0
  4.0.0.0
  System.String

  The return value of this method is identical to that of the method, except that it includes a space followed by the offset appended at the end of the string. In other words, it formats output using the short date pattern, the long time pattern, and the zzz custom format string, with each element separated from the previous element by a space. For example, if returns a value of 1/12/2008 6:15:50 PM, returns a value of 1/12/2008 6:15:50 PM -08:00 for a time that is eight hours behind Coordinated Universal Time (UTC).

  This method uses formatting information derived from the current culture. For more information, see . Other overloads of the method enable you to specify the culture whose formatting to use, and to define the output pattern of the value.

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

  A string representation of a object that includes the offset appended at the end of the string.

- Method
  2.0.0.0
  4.0.0.0
  System.String ``

  The return value of this method is identical to that of its equivalent overload of the method, except that it includes a space followed by the offset appended at the end of the string. In other words, it formats output using the short date pattern, the long time pattern, and the zzz custom format string, with each element separated from the previous element by a space.

  The format of these three elements is defined by the parameter. The parameter can be either of the following:

  A object that represents the culture whose formatting conventions are applied to the returned string. The object returned by the property defines the formatting of the returned string.

  A object that defines the format of date and time data.

  If is null, the object associated with the current culture is used (see ).

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

  A string representation of the value of the current object, as specified by .

  An object that supplies culture-specific formatting information.
- Method
  2.0.0.0
  4.0.0.0
  System.String ``

  The parameter should contain either a single format specifier character (see Standard DateTime Format Strings) or a custom format pattern (see Custom DateTime Format Strings) that defines the format of the returned string. If is a null or empty string (""), the value is output using the default format.

  The following table shows the exact operation of certain format specifiers when used with , which differs from their behavior when used with .

  Existing format specifier

  New behavior

  "K"

  Designed to round-trip a date and time. With , maps to "zzz" (the offset is always displayed with hours and minutes). Note that "K" is a custom format specifier; it cannot appear as the single character in .

  "U"

  Not supported.

  "r"

  Converts the object to Coordinated Universal Time (UTC) and outputs it using the custom format string ddd, dd MMM yyyy HH:mm:ss GMT.

  "u"

  Converts the object to UTC and outputs it using the format yyyy-MM-dd HH:mm:ssZ.

  The remaining standard date and time format specifiers behave the same with the method as they do with the method.

  This method uses formatting information derived from the current culture. For more information, see .

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

  A string representation of the value of the current object, as specified by .

  A format string.
- Method
  2.0.0.0
  4.0.0.0
  System.String `` ``

  The parameter should contain either a single format specifier character (see Standard DateTime Format Strings) or a custom format pattern (see Custom DateTime Format Strings). If is a null or empty string (""), the object is output using the default format.

  The following table shows the exact operation of certain format specifiers when used with , which differs from their behavior when used with .

  Existing format specifier

  New behavior

  "K"

  Designed to round-trip a date and time. With , maps to "zzz" (the offset is always displayed with hours and minutes). Note that "K" is a custom format specifier; it cannot appear as the single character in .

  "U"

  Not supported.

  "r"

  Converts the object to Coordinated Universal Time (UTC) and outputs it using the custom format string ddd, dd MMM yyyy HH:mm:ss GMT.

  "u"

  Converts the value to UTC and outputs it using the format yyyy-MM-dd HH:mm:ssZ.

  The remaining standard date and time format specifiers behave the same with the method as they do with the method.

  The pattern that corresponds to standard format specifiers, as well as the symbols and names of date and time components, is defined by the parameter. The parameter can be either of the following:

  A object that represents the culture whose formatting is used in . The object returned by the property defines the formatting used in .

  A object that defines the format of date and time data.

  If is null, the object associated with the current culture is used (see ).

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

  A string representation of the value of the current object, as specified by and .

  A format string. An object that supplies culture-specific formatting information.
- Method
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset

  This method returns a object whose property is set to zero.

  Both the value of the current object and the value of the object returned by the method call represent the same point in time. That is, if both are passed to the method, the method will return true.

  Converts the current object to a value that represents the Coordinated Universal Time (UTC).

  An object that represents the date and time of the current object converted to Coordinated Universal Time (UTC).

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.DateTime To be added.

  The property performs a dual conversion:

  It converts the date and time of the current object to Coordinated Universal Time (UTC). The conversion is performed by subtracting the value of the property from the date and time of the current object.

  It converts the value to a value.

  The property of the returned value is set to .

  Retrieving the value of the property is equivalent to calling the current object's ToUniversalTime.DateTime property, except that the property of the latter value is .

  Gets a value that represents the Coordinated Universal Time (UTC) date and time of the current object.

- Property
  2.0.0.0
  4.0.0.0
  System.DateTimeOffset To be added.

  The property computes the current Universal Coordinated Time (UTC) based on the local system's clock time and an offset defined by the local system's time zone.

  The precision of the current UTC time's millisecond component depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

  Gets a object whose date and time are set to the current Coordinated Universal Time (UTC) date and time and whose offset is .

- Property
  2.0.0.0
  4.0.0.0
  System.Int64 To be added.

  The value of the property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight on January 1, 0001 (the value of ). It does not include ticks that would be added by leap seconds. A nanosecond is one billionth of a second; there are ten million ticks in a second. The value of the property ranges from DateTimeOffset.MinValue.Ticks to DateTimeOffset.MaxValue.Ticks.

  Gets the number of ticks that represents the date and time of the current object in Coordinated Universal Time (UTC).

- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  The property is not affected by the value of the property.

  You can also create a string representation of a object's year component by calling the method with the "y", "yy", or "yyyy" custom format specifiers.

  Gets the year component of the date represented by the current object.