Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
6297 lines (5414 sloc) 457 KB
<Type Name="DateTimeOffset" FullName="System.DateTimeOffset">
<TypeSignature Language="C#" Value="public struct DateTimeOffset : IComparable, IComparable&lt;DateTimeOffset&gt;, IEquatable&lt;DateTimeOffset&gt;, IFormattable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit DateTimeOffset extends System.ValueType implements class System.IComparable, class System.IComparable`1&lt;valuetype System.DateTimeOffset&gt;, class System.IEquatable`1&lt;valuetype System.DateTimeOffset&gt;, class System.IFormattable, class System.Runtime.Serialization.IDeserializationCallback, class System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="DocId" Value="T:System.DateTimeOffset" />
<TypeSignature Language="VB.NET" Value="Public Structure DateTimeOffset&#xA;Implements IComparable, IComparable(Of DateTimeOffset), IDeserializationCallback, IEquatable(Of DateTimeOffset), IFormattable, ISerializable" />
<TypeSignature Language="C++ CLI" Value="public value class DateTimeOffset : IComparable, IComparable&lt;DateTimeOffset&gt;, IEquatable&lt;DateTimeOffset&gt;, IFormattable, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable" />
<TypeSignature Language="F#" Value="type DateTimeOffset = struct&#xA; interface IFormattable&#xA; interface ISerializable&#xA; interface IDeserializationCallback" />
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.ValueType</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IComparable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IComparable&lt;System.DateTimeOffset&gt;</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IEquatable&lt;System.DateTimeOffset&gt;</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IFormattable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Runtime.Serialization.IDeserializationCallback</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Serializable</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-3.0;netstandard-2.1">
<AttributeName>System.Runtime.CompilerServices.IsReadOnly</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Universal Time (UTC).</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset> structure includes a <xref:System.DateTime> value, together with an <xref:System.DateTimeOffset.Offset%2A> property that defines the difference between the current <xref:System.DateTimeOffset> instance's date and time and Coordinated Universal Time (UTC). Because it exactly defines a date and time relative to UTC, the <xref:System.DateTimeOffset> structure does not include a `Kind` member, as the <xref:System.DateTime> 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.).
[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)]
The time component of a <xref:System.DateTimeOffset> 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 <xref:System.Globalization.GregorianCalendar> calendar. A <xref:System.DateTimeOffset> 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.
Although a <xref:System.DateTimeOffset> 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 <xref:System.DateTimeOffset> value is disassociated from its time zone, it can no longer be unambiguously linked back to its original time zone.
Because <xref:System.DateTimeOffset> is a structure, a <xref:System.DateTimeOffset> object that has been declared but not otherwise initialized contains the default values for each of its member fields. This means that its <xref:System.DateTimeOffset.DateTime%2A> property is set to <xref:System.DateTimeOffset.MinValue?displayProperty=nameWithType> and its <xref:System.DateTimeOffset.Offset%2A> property is set to <xref:System.TimeSpan.Zero?displayProperty=nameWithType>.
You can create a new <xref:System.DateTimeOffset> value by calling any of the overloads of its constructor, which are similar to the overloaded constructors for the <xref:System.DateTime> structure. You can also create a new <xref:System.DateTimeOffset> value by assigning it a <xref:System.DateTime> 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 <xref:System.DateTimeOffset> value from the string representation of a date and time by calling a number of static string parsing methods, which include <xref:System.DateTimeOffset.Parse%2A>, <xref:System.DateTimeOffset.ParseExact%2A>, <xref:System.DateTimeOffset.TryParse%2A>, and <xref:System.DateTimeOffset.TryParseExact%2A>.
The members of the <xref:System.DateTimeOffset> structure provide functionality in the following areas:
- Date and time arithmetic.
You can add or subtract either dates or time intervals from a particular <xref:System.DateTimeOffset> value. Arithmetic operations with <xref:System.DateTimeOffset> values, unlike those with <xref:System.DateTime> values, adjust for differences in time offsets when returning a result. For example, the following code uses <xref:System.DateTime> variables to subtract the current local time from the current UTC time. The code then uses <xref:System.DateTimeOffset> variables to perform the same operation. The subtraction with <xref:System.DateTime> values returns the local time zone's difference from UTC, while the subtraction with <xref:System.DateTimeOffset> values returns <xref:System.TimeSpan.Zero?displayProperty=nameWithType>.
[!code-csharp[System.DateTimeOffset.Type#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Type/cs/Type.cs#1)]
[!code-vb[System.DateTimeOffset.Type#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Type/vb/Type.vb#1)]
- Type conversion operations.
You can convert <xref:System.DateTimeOffset> values to <xref:System.DateTimeOffset.DateTime%2A> values and vice versa.
- Time manipulation and extraction operations.
You can extract either the date or the time of a <xref:System.DateTimeOffset> value. You can also retrieve the value of a particular <xref:System.DateTimeOffset> component, such as its year or its month.
> [!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 <xref:System.TimeSpan.TicksPerDay?displayProperty=nameWithType>, <xref:System.TimeSpan.TicksPerHour?displayProperty=nameWithType>, <xref:System.TimeSpan.TicksPerMinute?displayProperty=nameWithType>, <xref:System.TimeSpan.TicksPerSecond?displayProperty=nameWithType>, or <xref:System.TimeSpan.TicksPerMillisecond?displayProperty=nameWithType> constant to perform the conversion. For example, to add the number of seconds represented by a specified number of ticks to the <xref:System.DateTimeOffset.Second%2A> component of a <xref:System.DateTimeOffset> value, you can use the expression `dateValue.Second + nTicks/Timespan.TicksPerSecond`.
- Date and time conversion.
You can convert any <xref:System.DateTimeOffset> value to another <xref:System.DateTimeOffset> 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 <xref:System.DateTimeOffset.ToLocalTime%2A> method, which converts a <xref:System.DateTimeOffset> value to the date and time in the local system zone.
- Date and time comparison.
You can determine whether any particular <xref:System.DateTimeOffset> value is earlier than, the same as, or later than another <xref:System.DateTimeOffset> value. Before the comparison is performed, all values are converted to UTC.
]]></format>
</remarks>
<related type="Article" href="~/docs/standard/datetime/choosing-between-datetime.md">Choosing Between DateTime, DateTimeOffset, TimeSpan, and TimeZoneInfo</related>
<related type="ExternalDocumentation" href="https://code.msdn.microsoft.com/NET-Framework-4-Formatting-9c4dae8d">Sample: .NET Framework 4 Formatting Utility</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.DateTimeOffset" /> structure.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DateTimeOffset (DateTime dateTime);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.DateTime dateTime) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.#ctor(System.DateTime)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset(DateTime dateTime);" />
<MemberSignature Language="F#" Value="new DateTimeOffset : DateTime -&gt; DateTimeOffset" Usage="new System.DateTimeOffset dateTime" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="dateTime" Type="System.DateTime" />
</Parameters>
<Docs>
<param name="dateTime">A date and time.</param>
<summary>Initializes a new instance of the <see cref="T:System.DateTimeOffset" /> structure using the specified <see cref="T:System.DateTime" /> value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor's behavior depends on the value of the <xref:System.DateTime.Kind%2A?displayProperty=nameWithType> property of the `dateTime` parameter:
- If the value of <xref:System.DateTime.Kind%2A?displayProperty=nameWithType> is <xref:System.DateTimeKind.Utc?displayProperty=nameWithType>, the <xref:System.DateTimeOffset.DateTime%2A> property of the new instance is set equal to `dateTime`, and the <xref:System.DateTimeOffset.Offset%2A> property is set equal to <xref:System.TimeSpan.Zero>.
- If the value of <xref:System.DateTime.Kind%2A?displayProperty=nameWithType> is <xref:System.DateTimeKind.Local?displayProperty=nameWithType> or <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType>, the <xref:System.DateTimeOffset.DateTime%2A> property of the new instance is set equal to `dateTime`, and the <xref:System.DateTimeOffset.Offset%2A> property is set equal to the offset of the local system's current time zone.
## Examples
The following example illustrates how the value of the <xref:System.DateTime.Kind%2A?displayProperty=nameWithType> property of the `dateTime` parameter affects the date and time value that is returned by this constructor.
[!code-csharp[System.DateTimeOffset.Constructors#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs#1)]
[!code-vb[System.DateTimeOffset.Constructors#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/vb/Constructors.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The Coordinated Universal Time (UTC) date and time that results from applying the offset is earlier than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The UTC date and time that results from applying the offset is later than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/instantiating-a-datetimeoffset-object.md">Instantiating a DateTimeOffset Object</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DateTimeOffset (DateTime dateTime, TimeSpan offset);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.DateTime dateTime, valuetype System.TimeSpan offset) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.#ctor(System.DateTime,System.TimeSpan)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset(DateTime dateTime, TimeSpan offset);" />
<MemberSignature Language="F#" Value="new DateTimeOffset : DateTime * TimeSpan -&gt; DateTimeOffset" Usage="new System.DateTimeOffset (dateTime, offset)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="dateTime" Type="System.DateTime" />
<Parameter Name="offset" Type="System.TimeSpan" />
</Parameters>
<Docs>
<param name="dateTime">A date and time.</param>
<param name="offset">The time's offset from Coordinated Universal Time (UTC).</param>
<summary>Initializes a new instance of the <see cref="T:System.DateTimeOffset" /> structure using the specified <see cref="T:System.DateTime" /> value and offset.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor's behavior depends in part on the value of the <xref:System.DateTime.Kind%2A> property of the `dateTime` parameter:
- If the value of <xref:System.DateTime.Kind%2A> is <xref:System.DateTimeKind.Utc?displayProperty=nameWithType>, the value of the `offset` parameter must be 0 or an <xref:System.ArgumentException> is thrown.
- If the value of <xref:System.DateTime.Kind%2A> is <xref:System.DateTimeKind.Local?displayProperty=nameWithType>, the value of the `offset` parameter must be equal to the local time zone's offset from Coordinated Universal Time (UTC) for that particular date or an <xref:System.ArgumentException> is thrown.
- If the value of <xref:System.DateTime.Kind%2A> is <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType>, the `offset` parameter can have any valid value.
## Examples
The following example shows how to initialize a <xref:System.DateTimeOffset> object with a date and time and the offset of the local time zone when that time zone is not known in advance.
[!code-csharp[System.DateTimeOffset.Constructors#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs#3)]
[!code-vb[System.DateTimeOffset.Constructors#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/vb/Constructors.vb#3)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="dateTime.Kind" /> equals <see cref="F:System.DateTimeKind.Utc" /> and <paramref name="offset" /> does not equal zero.
-or-
<paramref name="dateTime.Kind" /> equals <see cref="F:System.DateTimeKind.Local" /> and <paramref name="offset" /> does not equal the offset of the system's local time zone.
-or-
<paramref name="offset" /> is not specified in whole minutes.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="offset" /> is less than -14 hours or greater than 14 hours.
-or-
<see cref="P:System.DateTimeOffset.UtcDateTime" /> is less than <see cref="F:System.DateTimeOffset.MinValue" /> or greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/instantiating-a-datetimeoffset-object.md">Instantiating a DateTimeOffset Object</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DateTimeOffset (long ticks, TimeSpan offset);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int64 ticks, valuetype System.TimeSpan offset) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.#ctor(System.Int64,System.TimeSpan)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (ticks As Long, offset As TimeSpan)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset(long ticks, TimeSpan offset);" />
<MemberSignature Language="F#" Value="new DateTimeOffset : int64 * TimeSpan -&gt; DateTimeOffset" Usage="new System.DateTimeOffset (ticks, offset)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="ticks" Type="System.Int64" />
<Parameter Name="offset" Type="System.TimeSpan" />
</Parameters>
<Docs>
<param name="ticks">A date and time expressed as the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight on January 1, 0001.</param>
<param name="offset">The time's offset from Coordinated Universal Time (UTC).</param>
<summary>Initializes a new instance of the <see cref="T:System.DateTimeOffset" /> structure using the specified number of ticks and offset.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Ordinarily, trying to call the <xref:System.DateTimeOffset.%23ctor%2A> constructor to instantiate a <xref:System.DateTimeOffset> value with a local time and an offset other than that of the local time zone throws an <xref:System.ArgumentException>. You can use this overload of the <xref:System.DateTimeOffset> constructor to work around this limitation. The following example uses the local time's number of ticks to instantiate a <xref:System.DateTimeOffset> value whose offset does not necessarily represent that of the local time:
[!code-csharp[System.DateTimeOffset.Constructors#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs#4)]
[!code-vb[System.DateTimeOffset.Constructors#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/vb/Constructors.vb#4)]
## Examples
The following example initializes a <xref:System.DateTimeOffset> object by using the number of ticks in an arbitrary date (in this case, July 16, 2007, at 1:32 PM) with an offset of -5.
[!code-csharp[System.DateTimeOffset.Constructors#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs#2)]
[!code-vb[System.DateTimeOffset.Constructors#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/vb/Constructors.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="offset" /> is not specified in whole minutes.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The <see cref="P:System.DateTimeOffset.UtcDateTime" /> property is earlier than <see cref="F:System.DateTimeOffset.MinValue" /> or later than <see cref="F:System.DateTimeOffset.MaxValue" />.
-or-
<paramref name="ticks" /> is less than <see langword="DateTimeOffset.MinValue.Ticks" /> or greater than <see langword="DateTimeOffset.MaxValue.Ticks" />.
-or-
<paramref name="Offset" /> s less than -14 hours or greater than 14 hours.</exception>
<related type="Article" href="~/docs/standard/datetime/instantiating-a-datetimeoffset-object.md">Instantiating a DateTimeOffset Object</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DateTimeOffset (int year, int month, int day, int hour, int minute, int second, TimeSpan offset);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second, valuetype System.TimeSpan offset) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.#ctor(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.TimeSpan)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (year As Integer, month As Integer, day As Integer, hour As Integer, minute As Integer, second As Integer, offset As TimeSpan)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset(int year, int month, int day, int hour, int minute, int second, TimeSpan offset);" />
<MemberSignature Language="F#" Value="new DateTimeOffset : int * int * int * int * int * int * TimeSpan -&gt; DateTimeOffset" Usage="new System.DateTimeOffset (year, month, day, hour, minute, second, offset)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
<Parameter Name="month" Type="System.Int32" />
<Parameter Name="day" Type="System.Int32" />
<Parameter Name="hour" Type="System.Int32" />
<Parameter Name="minute" Type="System.Int32" />
<Parameter Name="second" Type="System.Int32" />
<Parameter Name="offset" Type="System.TimeSpan" />
</Parameters>
<Docs>
<param name="year">The year (1 through 9999).</param>
<param name="month">The month (1 through 12).</param>
<param name="day">The day (1 through the number of days in <paramref name="month" />).</param>
<param name="hour">The hours (0 through 23).</param>
<param name="minute">The minutes (0 through 59).</param>
<param name="second">The seconds (0 through 59).</param>
<param name="offset">The time's offset from Coordinated Universal Time (UTC).</param>
<summary>Initializes a new instance of the <see cref="T:System.DateTimeOffset" /> structure using the specified year, month, day, hour, minute, second, and offset.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor interprets `year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a <xref:System.DateTimeOffset> value by using the year, month, and day in another calendar, call the <xref:System.DateTimeOffset.%23ctor%28System.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Globalization.Calendar%2CSystem.TimeSpan%29> constructor.
## Examples
The following example instantiates a <xref:System.DateTimeOffset> object by using the <xref:System.DateTimeOffset.%23ctor%28System.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.TimeSpan%29?displayProperty=nameWithType> constructor overload.
[!code-csharp[System.DateTimeOffset.Constructors#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs#5)]
[!code-vb[System.DateTimeOffset.Constructors#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/vb/Constructors.vb#5)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="offset" /> does not represent whole minutes.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is less than one or greater than 9999.
-or-
<paramref name="month" /> is less than one or greater than 12.
-or-
<paramref name="day" /> is less than one or greater than the number of days in <paramref name="month" />.
-or-
<paramref name="hour" /> is less than zero or greater than 23.
-or-
<paramref name="minute" /> is less than 0 or greater than 59.
-or-
<paramref name="second" /> is less than 0 or greater than 59.
-or-
<paramref name="offset" /> is less than -14 hours or greater than 14 hours.
-or-
The <see cref="P:System.DateTimeOffset.UtcDateTime" /> property is earlier than <see cref="F:System.DateTimeOffset.MinValue" /> or later than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/instantiating-a-datetimeoffset-object.md">Instantiating a DateTimeOffset Object</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DateTimeOffset (int year, int month, int day, int hour, int minute, int second, int millisecond, TimeSpan offset);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second, int32 millisecond, valuetype System.TimeSpan offset) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.#ctor(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.TimeSpan)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (year As Integer, month As Integer, day As Integer, hour As Integer, minute As Integer, second As Integer, millisecond As Integer, offset As TimeSpan)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, TimeSpan offset);" />
<MemberSignature Language="F#" Value="new DateTimeOffset : int * int * int * int * int * int * int * TimeSpan -&gt; DateTimeOffset" Usage="new System.DateTimeOffset (year, month, day, hour, minute, second, millisecond, offset)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="year" Type="System.Int32" />
<Parameter Name="month" Type="System.Int32" />
<Parameter Name="day" Type="System.Int32" />
<Parameter Name="hour" Type="System.Int32" />
<Parameter Name="minute" Type="System.Int32" />
<Parameter Name="second" Type="System.Int32" />
<Parameter Name="millisecond" Type="System.Int32" />
<Parameter Name="offset" Type="System.TimeSpan" />
</Parameters>
<Docs>
<param name="year">The year (1 through 9999).</param>
<param name="month">The month (1 through 12).</param>
<param name="day">The day (1 through the number of days in <paramref name="month" />).</param>
<param name="hour">The hours (0 through 23).</param>
<param name="minute">The minutes (0 through 59).</param>
<param name="second">The seconds (0 through 59).</param>
<param name="millisecond">The milliseconds (0 through 999).</param>
<param name="offset">The time's offset from Coordinated Universal Time (UTC).</param>
<summary>Initializes a new instance of the <see cref="T:System.DateTimeOffset" /> structure using the specified year, month, day, hour, minute, second, millisecond, and offset.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor interprets `year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a <xref:System.DateTimeOffset> value by using the year, month, and day in another calendar, call the <xref:System.DateTimeOffset.%23ctor%28System.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Globalization.Calendar%2CSystem.TimeSpan%29> constructor.
## Examples
The following example instantiates a <xref:System.DateTimeOffset> object by using the <xref:System.DateTimeOffset.%23ctor%28System.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.TimeSpan%29?displayProperty=nameWithType> constructor overload.
[!code-csharp[System.DateTimeOffset.Constructors#7](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs#7)]
[!code-vb[System.DateTimeOffset.Constructors#7](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/vb/Constructors.vb#7)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="offset" /> does not represent whole minutes.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is less than one or greater than 9999.
-or-
<paramref name="month" /> is less than one or greater than 12.
-or-
<paramref name="day" /> is less than one or greater than the number of days in <paramref name="month" />.
-or-
<paramref name="hour" /> is less than zero or greater than 23.
-or-
<paramref name="minute" /> is less than 0 or greater than 59.
-or-
<paramref name="second" /> is less than 0 or greater than 59.
-or-
<paramref name="millisecond" /> is less than 0 or greater than 999.
-or-
<paramref name="offset" /> is less than -14 or greater than 14.
-or-
The <see cref="P:System.DateTimeOffset.UtcDateTime" /> property is earlier than <see cref="F:System.DateTimeOffset.MinValue" /> or later than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/instantiating-a-datetimeoffset-object.md">Instantiating a DateTimeOffset Object</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DateTimeOffset (int year, int month, int day, int hour, int minute, int second, int millisecond, System.Globalization.Calendar calendar, TimeSpan offset);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second, int32 millisecond, class System.Globalization.Calendar calendar, valuetype System.TimeSpan offset) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.#ctor(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Globalization.Calendar,System.TimeSpan)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, System::Globalization::Calendar ^ calendar, TimeSpan offset);" />
<MemberSignature Language="F#" Value="new DateTimeOffset : int * int * int * int * int * int * int * System.Globalization.Calendar * TimeSpan -&gt; DateTimeOffset" Usage="new System.DateTimeOffset (year, month, day, hour, minute, second, millisecond, calendar, offset)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="year" Type="System.Int32" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="month" Type="System.Int32" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="day" Type="System.Int32" Index="2" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="hour" Type="System.Int32" Index="3" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="minute" Type="System.Int32" Index="4" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="second" Type="System.Int32" Index="5" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="millisecond" Type="System.Int32" Index="6" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="calendar" Type="System.Globalization.Calendar" Index="7" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="offset" Type="System.TimeSpan" Index="8" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="year">The year.</param>
<param name="month">The month (1 through 12).</param>
<param name="day">The day (1 through the number of days in <paramref name="month" />).</param>
<param name="hour">The hours (0 through 23).</param>
<param name="minute">The minutes (0 through 59).</param>
<param name="second">The seconds (0 through 59).</param>
<param name="millisecond">The milliseconds (0 through 999).</param>
<param name="calendar">The calendar that is used to interpret <paramref name="year" />, <paramref name="month" />, and <paramref name="day" />.</param>
<param name="offset">The time's offset from Coordinated Universal Time (UTC).</param>
<summary>Initializes a new instance of the <see cref="T:System.DateTimeOffset" /> structure using the specified year, month, day, hour, minute, second, millisecond, and offset of a specified calendar.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `year`, `month`, `day`, `hour`, `minute`, `second`, and `millisecond` parameters all reflect values expressed in the calendar specified by the `calendar` parameter. An exception is thrown if these values form a date and time that cannot be expressed by using this calendar.
[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)]
## Examples
The following example uses instances of both the <xref:System.Globalization.HebrewCalendar> class and the <xref:System.Globalization.HijriCalendar> class to instantiate a <xref:System.DateTimeOffset> value. That date is then displayed to the console using the respective calendars and the Gregorian calendar.
[!code-csharp[System.DateTimeOffset.Constructors#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs#8)]
[!code-vb[System.DateTimeOffset.Constructors#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/vb/Constructors.vb#8)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="offset" /> does not represent whole minutes.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="calendar" /> cannot be <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="year" /> is less than the <paramref name="calendar" /> parameter's <see langword="MinSupportedDateTime.Year" /> or greater than <see langword="MaxSupportedDateTime.Year" />.
-or-
<paramref name="month" /> is either less than or greater than the number of months in <paramref name="year" /> in the <paramref name="calendar" />.
-or-
<paramref name="day" /> is less than one or greater than the number of days in <paramref name="month" />.
-or-
<paramref name="hour" /> is less than zero or greater than 23.
-or-
<paramref name="minute" /> is less than 0 or greater than 59.
-or-
<paramref name="second" /> is less than 0 or greater than 59.
-or-
<paramref name="millisecond" /> is less than 0 or greater than 999.
-or-
<paramref name="offset" /> is less than -14 hours or greater than 14 hours.
-or-
The <paramref name="year" />, <paramref name="month" />, and <paramref name="day" /> parameters cannot be represented as a date and time value.
-or-
The <see cref="P:System.DateTimeOffset.UtcDateTime" /> property is earlier than <see cref="F:System.DateTimeOffset.MinValue" /> or later than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/instantiating-a-datetimeoffset-object.md">Instantiating a DateTimeOffset Object</related>
</Docs>
</Member>
<Member MemberName="Add">
<MemberSignature Language="C#" Value="public DateTimeOffset Add (TimeSpan timeSpan);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.DateTimeOffset Add(valuetype System.TimeSpan timeSpan) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.Add(System.TimeSpan)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset Add(TimeSpan timeSpan);" />
<MemberSignature Language="F#" Value="member this.Add : TimeSpan -&gt; DateTimeOffset" Usage="dateTimeOffset.Add timeSpan" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="timeSpan" Type="System.TimeSpan" />
</Parameters>
<Docs>
<param name="timeSpan">A <see cref="T:System.TimeSpan" /> object that represents a positive or a negative time interval.</param>
<summary>Returns a new <see cref="T:System.DateTimeOffset" /> object that adds a specified time interval to the value of this instance.</summary>
<returns>An object whose value is the sum of the date and time represented by the current <see cref="T:System.DateTimeOffset" /> object and the time interval represented by <paramref name="timeSpan" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use the <xref:System.DateTimeOffset.Add%2A> 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 <xref:System.DateTimeOffset> structure also supports specialized addition methods (such as <xref:System.DateTimeOffset.AddDays%2A>, <xref:System.DateTimeOffset.AddHours%2A>, and <xref:System.DateTimeOffset.AddMinutes%2A>) for each time interval.
> [!NOTE]
> This method returns a new <xref:System.DateTimeOffset> object. It does not modify the value of the current object by adding `timeSpan` to its date and time.
The <xref:System.DateTimeOffset.Add%2A> method does not affect the value of the current <xref:System.DateTimeOffset> object's <xref:System.DateTimeOffset.Offset%2A> property.
Because a <xref:System.DateTimeOffset> object does not represent the date and time in a specific time zone, the <xref:System.DateTimeOffset.Add%2A> method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.
If the `timeSpan` parameter is `null`, this method returns the value of the original <xref:System.DateTimeOffset> object unchanged.
## Examples
The following example creates an array of <xref:System.TimeSpan> objects that represent the flight times between destinations. The <xref:System.DateTimeOffset.Add%2A> method then adds these times to a <xref:System.DateTimeOffset> object that represents a flight's initial takeoff time. The result reflects the scheduled arrival time at each destination.
[!code-csharp[System.DateTimeOffset.Methods#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs#1)]
[!code-vb[System.DateTimeOffset.Methods#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<altmember cref="M:System.DateTimeOffset.op_Addition(System.DateTimeOffset,System.TimeSpan)" />
<related type="Article" href="~/docs/standard/datetime/performing-arithmetic-operations.md">Performing Arithmetic Operations with Dates and Times</related>
</Docs>
</Member>
<Member MemberName="AddDays">
<MemberSignature Language="C#" Value="public DateTimeOffset AddDays (double days);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.DateTimeOffset AddDays(float64 days) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.AddDays(System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Function AddDays (days As Double) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset AddDays(double days);" />
<MemberSignature Language="F#" Value="member this.AddDays : double -&gt; DateTimeOffset" Usage="dateTimeOffset.AddDays days" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="days" Type="System.Double" />
</Parameters>
<Docs>
<param name="days">A number of whole and fractional days. The number can be negative or positive.</param>
<summary>Returns a new <see cref="T:System.DateTimeOffset" /> object that adds a specified number of whole and fractional days to the value of this instance.</summary>
<returns>An object whose value is the sum of the date and time represented by the current <see cref="T:System.DateTimeOffset" /> object and the number of days represented by <paramref name="days" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The fractional part of the `days` 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 `days` parameter is rounded to the nearest millisecond.
> [!NOTE]
> This method returns a new <xref:System.DateTimeOffset> object. It does not modify the value of the current object by adding `days` to its date and time.
Because a <xref:System.DateTimeOffset> object does not represent the date and time in a specific time zone, the <xref:System.DateTimeOffset.AddDays%2A> 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 <xref:System.DateTimeOffset.Add%2A> 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.
## Examples
The following example uses the <xref:System.DateTimeOffset.AddDays%2A> method to list the dates that fall on Monday, the start of the work week, in March 2008.
[!code-csharp[System.DateTimeOffset.Methods#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs#2)]
[!code-vb[System.DateTimeOffset.Methods#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
</Docs>
</Member>
<Member MemberName="AddHours">
<MemberSignature Language="C#" Value="public DateTimeOffset AddHours (double hours);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.DateTimeOffset AddHours(float64 hours) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.AddHours(System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Function AddHours (hours As Double) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset AddHours(double hours);" />
<MemberSignature Language="F#" Value="member this.AddHours : double -&gt; DateTimeOffset" Usage="dateTimeOffset.AddHours hours" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="hours" Type="System.Double" />
</Parameters>
<Docs>
<param name="hours">A number of whole and fractional hours. The number can be negative or positive.</param>
<summary>Returns a new <see cref="T:System.DateTimeOffset" /> object that adds a specified number of whole and fractional hours to the value of this instance.</summary>
<returns>An object whose value is the sum of the date and time represented by the current <see cref="T:System.DateTimeOffset" /> object and the number of hours represented by <paramref name="hours" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The fractional part of the `hours` parameter is the fractional part of an hour. For example, 4.5 is equivalent to 4 hours, 30 minutes, 0 seconds, 0 milliseconds. The `hours` parameter is rounded to the nearest millisecond.
> [!NOTE]
> This method returns a new <xref:System.DateTimeOffset> object. It does not modify the value of the current object by adding `hours` to its date and time.
Because a <xref:System.DateTimeOffset> object does not represent the date and time in a specific time zone, the <xref:System.DateTimeOffset.AddHours%2A> 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 <xref:System.DateTimeOffset.Add%2A> 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.
## Examples
The following example uses the <xref:System.DateTimeOffset.AddHours%2A> method to list the start times of work shifts for a particular week at an office that has two eight-hour shifts per day.
[!code-csharp[System.DateTimeOffset.Methods#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs#3)]
[!code-vb[System.DateTimeOffset.Methods#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods.vb#3)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/performing-arithmetic-operations.md">Performing Arithmetic Operations with Dates and Times</related>
</Docs>
</Member>
<Member MemberName="AddMilliseconds">
<MemberSignature Language="C#" Value="public DateTimeOffset AddMilliseconds (double milliseconds);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.DateTimeOffset AddMilliseconds(float64 milliseconds) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.AddMilliseconds(System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Function AddMilliseconds (milliseconds As Double) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset AddMilliseconds(double milliseconds);" />
<MemberSignature Language="F#" Value="member this.AddMilliseconds : double -&gt; DateTimeOffset" Usage="dateTimeOffset.AddMilliseconds milliseconds" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="milliseconds" Type="System.Double" />
</Parameters>
<Docs>
<param name="milliseconds">A number of whole and fractional milliseconds. The number can be negative or positive.</param>
<summary>Returns a new <see cref="T:System.DateTimeOffset" /> object that adds a specified number of milliseconds to the value of this instance.</summary>
<returns>An object whose value is the sum of the date and time represented by the current <see cref="T:System.DateTimeOffset" /> object and the number of whole milliseconds represented by <paramref name="milliseconds" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The fractional part of the `milliseconds` 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, `milliseconds` is rounded to the nearest millisecond; all values of .5 or greater are rounded up.
> [!NOTE]
> This method returns a new <xref:System.DateTimeOffset> object. It does not modify the value of the current object by adding `milliseconds` to its date and time.
Because a <xref:System.DateTimeOffset> object does not represent the date and time in a specific time zone, the <xref:System.DateTimeOffset.AddMilliseconds%2A> method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/performing-arithmetic-operations.md">Performing Arithmetic Operations with Dates and Times</related>
</Docs>
</Member>
<Member MemberName="AddMinutes">
<MemberSignature Language="C#" Value="public DateTimeOffset AddMinutes (double minutes);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.DateTimeOffset AddMinutes(float64 minutes) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.AddMinutes(System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Function AddMinutes (minutes As Double) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset AddMinutes(double minutes);" />
<MemberSignature Language="F#" Value="member this.AddMinutes : double -&gt; DateTimeOffset" Usage="dateTimeOffset.AddMinutes minutes" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="minutes" Type="System.Double" />
</Parameters>
<Docs>
<param name="minutes">A number of whole and fractional minutes. The number can be negative or positive.</param>
<summary>Returns a new <see cref="T:System.DateTimeOffset" /> object that adds a specified number of whole and fractional minutes to the value of this instance.</summary>
<returns>An object whose value is the sum of the date and time represented by the current <see cref="T:System.DateTimeOffset" /> object and the number of minutes represented by <paramref name="minutes" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The fractional part of the `minutes` parameter is the fractional part of a minute. For example, 4.5 is equivalent to 4 minutes, 30 seconds, 0 milliseconds. The `minutes` parameter is rounded to the nearest millisecond.
> [!NOTE]
> This method returns a new <xref:System.DateTimeOffset> object. It does not modify the value of the current object by adding `minutes` to its date and time.
Because a <xref:System.DateTimeOffset> object does not represent the date and time in a specific time zone, the <xref:System.DateTimeOffset.AddMinutes%2A> 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 <xref:System.DateTimeOffset.Add%2A> 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.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/performing-arithmetic-operations.md">Performing Arithmetic Operations with Dates and Times</related>
</Docs>
</Member>
<Member MemberName="AddMonths">
<MemberSignature Language="C#" Value="public DateTimeOffset AddMonths (int months);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.DateTimeOffset AddMonths(int32 months) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.AddMonths(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function AddMonths (months As Integer) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset AddMonths(int months);" />
<MemberSignature Language="F#" Value="member this.AddMonths : int -&gt; DateTimeOffset" Usage="dateTimeOffset.AddMonths months" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="months" Type="System.Int32" />
</Parameters>
<Docs>
<param name="months">A number of whole months. The number can be negative or positive.</param>
<summary>Returns a new <see cref="T:System.DateTimeOffset" /> object that adds a specified number of months to the value of this instance.</summary>
<returns>An object whose value is the sum of the date and time represented by the current <see cref="T:System.DateTimeOffset" /> object and the number of months represented by <paramref name="months" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Unlike most of the other methods that add a single time interval unit (such as minutes or days) to a date and time value, <xref:System.DateTimeOffset.AddMonths%2A> 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 <xref:System.DateTimeOffset> object, use the <xref:System.DateTimeOffset.Add%2A> method.
> [!NOTE]
> This method returns a new <xref:System.DateTimeOffset> object. It does not modify the value of the current object by adding `months` to its date and time.
## Examples
The following example uses the <xref:System.DateTimeOffset.AddMonths%2A> method to display the start date of each quarter of the year 2007.
[!code-csharp[System.DateTimeOffset.Methods#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs#4)]
[!code-vb[System.DateTimeOffset.Methods#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods.vb#4)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
</Docs>
</Member>
<Member MemberName="AddSeconds">
<MemberSignature Language="C#" Value="public DateTimeOffset AddSeconds (double seconds);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.DateTimeOffset AddSeconds(float64 seconds) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.AddSeconds(System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Function AddSeconds (seconds As Double) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset AddSeconds(double seconds);" />
<MemberSignature Language="F#" Value="member this.AddSeconds : double -&gt; DateTimeOffset" Usage="dateTimeOffset.AddSeconds seconds" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="seconds" Type="System.Double" />
</Parameters>
<Docs>
<param name="seconds">A number of whole and fractional seconds. The number can be negative or positive.</param>
<summary>Returns a new <see cref="T:System.DateTimeOffset" /> object that adds a specified number of whole and fractional seconds to the value of this instance.</summary>
<returns>An object whose value is the sum of the date and time represented by the current <see cref="T:System.DateTimeOffset" /> object and the number of seconds represented by <paramref name="seconds" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The fractional part of the `seconds` 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 `seconds` parameter is rounded to the nearest millisecond.
> [!NOTE]
> This method returns a new <xref:System.DateTimeOffset> object. It does not modify the value of the current object by adding `minutes` to its date and time.
Because a <xref:System.DateTimeOffset> object does not represent the date and time in a specific time zone, the <xref:System.DateTimeOffset.AddSeconds%2A> method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/performing-arithmetic-operations.md">Performing Arithmetic Operations with Dates and Times</related>
</Docs>
</Member>
<Member MemberName="AddTicks">
<MemberSignature Language="C#" Value="public DateTimeOffset AddTicks (long ticks);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.DateTimeOffset AddTicks(int64 ticks) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.AddTicks(System.Int64)" />
<MemberSignature Language="VB.NET" Value="Public Function AddTicks (ticks As Long) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset AddTicks(long ticks);" />
<MemberSignature Language="F#" Value="member this.AddTicks : int64 -&gt; DateTimeOffset" Usage="dateTimeOffset.AddTicks ticks" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ticks" Type="System.Int64" />
</Parameters>
<Docs>
<param name="ticks">A number of 100-nanosecond ticks. The number can be negative or positive.</param>
<summary>Returns a new <see cref="T:System.DateTimeOffset" /> object that adds a specified number of ticks to the value of this instance.</summary>
<returns>An object whose value is the sum of the date and time represented by the current <see cref="T:System.DateTimeOffset" /> object and the number of ticks represented by <paramref name="ticks" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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.
> [!NOTE]
> This method returns a new <xref:System.DateTimeOffset> object. It does not modify the value of the current object by adding `minutes` 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 <xref:System.DateTimeOffset> object does not represent the date and time in a specific time zone, the <xref:System.DateTimeOffset.AddTicks%2A> method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<related type="Article" href="~/docs/standard/datetime/performing-arithmetic-operations.md">Performing Arithmetic Operations with Dates and Times</related>
</Docs>
</Member>
<Member MemberName="AddYears">
<MemberSignature Language="C#" Value="public DateTimeOffset AddYears (int years);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.DateTimeOffset AddYears(int32 years) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.AddYears(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function AddYears (years As Integer) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DateTimeOffset AddYears(int years);" />
<MemberSignature Language="F#" Value="member this.AddYears : int -&gt; DateTimeOffset" Usage="dateTimeOffset.AddYears years" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="years" Type="System.Int32" />
</Parameters>
<Docs>
<param name="years">A number of years. The number can be negative or positive.</param>
<summary>Returns a new <see cref="T:System.DateTimeOffset" /> object that adds a specified number of years to the value of this instance.</summary>
<returns>An object whose value is the sum of the date and time represented by the current <see cref="T:System.DateTimeOffset" /> object and the number of years represented by <paramref name="years" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Unlike most of the other methods that add a single time interval unit (such as minutes or days) to a date and time value, <xref:System.DateTimeOffset.AddYears%2A> 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 <xref:System.DateTimeOffset> object, use the <xref:System.DateTimeOffset.Add%2A> method.
> [!NOTE]
> This method returns a new <xref:System.DateTimeOffset> object. It does not modify the value of the current object by adding `months` to its date and time.
## Examples
In the United States, driver's licenses cannot be issued to persons under 16 years of age. The following example displays the latest possible date on which a person must be born in order to legally be issued a driver's license.
[!code-csharp[System.DateTimeOffset.Methods#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs#6)]
[!code-vb[System.DateTimeOffset.Methods#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods.vb#6)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
</Docs>
</Member>
<Member MemberName="Compare">
<MemberSignature Language="C#" Value="public static int Compare (DateTimeOffset first, DateTimeOffset second);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 Compare(valuetype System.DateTimeOffset first, valuetype System.DateTimeOffset second) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.Compare(System.DateTimeOffset,System.DateTimeOffset)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Compare (first As DateTimeOffset, second As DateTimeOffset) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static int Compare(DateTimeOffset first, DateTimeOffset second);" />
<MemberSignature Language="F#" Value="static member Compare : DateTimeOffset * DateTimeOffset -&gt; int" Usage="System.DateTimeOffset.Compare (first, second)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="first" Type="System.DateTimeOffset" />
<Parameter Name="second" Type="System.DateTimeOffset" />
</Parameters>
<Docs>
<param name="first">The first object to compare.</param>
<param name="second">The second object to compare.</param>
<summary>Compares two <see cref="T:System.DateTimeOffset" /> objects and indicates whether the first is earlier than the second, equal to the second, or later than the second.</summary>
<returns>A signed integer that indicates whether the value of the <paramref name="first" /> parameter is earlier than, later than, or the same time as the value of the <paramref name="second" /> parameter, as the following table shows.
<list type="table"><listheader><term> Return value
</term><description> Meaning
</description></listheader><item><term> Less than zero
</term><description><paramref name="first" /> is earlier than <paramref name="second" />.
</description></item><item><term> Zero
</term><description><paramref name="first" /> is equal to <paramref name="second" />.
</description></item><item><term> Greater than zero
</term><description><paramref name="first" /> is later than <paramref name="second" />.
</description></item></list></returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In performing the comparison, the method converts both the `first` and the `second` parameters to Coordinated Universal Time (UTC) before it performs the comparison. The method is equivalent to the following:
[!code-csharp[System.DateTimeOffset.Syntax#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs#1)]
[!code-vb[System.DateTimeOffset.Syntax#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/vb/Syntax.vb#1)]
In other words, the <xref:System.DateTimeOffset.Compare%2A> method determines whether two <xref:System.DateTimeOffset> objects represent a single point in time. It directly compares neither dates and times nor offsets.
## Examples
The following example illustrates calls to the <xref:System.DateTimeOffset.Compare%2A> method to compare <xref:System.DateTimeOffset> objects.
[!code-csharp[System.DateTimeOffset.Methods#7](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods2.cs#7)]
[!code-vb[System.DateTimeOffset.Methods#7](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods2.vb#7)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CompareTo">
<MemberSignature Language="C#" Value="public int CompareTo (DateTimeOffset other);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 CompareTo(valuetype System.DateTimeOffset other) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.CompareTo(System.DateTimeOffset)" />
<MemberSignature Language="VB.NET" Value="Public Function CompareTo (other As DateTimeOffset) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual int CompareTo(DateTimeOffset other);" />
<MemberSignature Language="F#" Value="abstract member CompareTo : DateTimeOffset -&gt; int&#xA;override this.CompareTo : DateTimeOffset -&gt; int" Usage="dateTimeOffset.CompareTo other" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IComparable`1.CompareTo(`0)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="other" Type="System.DateTimeOffset" />
</Parameters>
<Docs>
<param name="other">An object to compare with the current <see cref="T:System.DateTimeOffset" /> object.</param>
<summary>Compares the current <see cref="T:System.DateTimeOffset" /> object to a specified <see cref="T:System.DateTimeOffset" /> object and indicates whether the current object is earlier than, the same as, or later than the second <see cref="T:System.DateTimeOffset" /> object.</summary>
<returns>A signed integer that indicates the relationship between the current <see cref="T:System.DateTimeOffset" /> object and <paramref name="other" />, as the following table shows.
<list type="table"><listheader><term> Return Value
</term><description> Description
</description></listheader><item><term> Less than zero
</term><description> The current <see cref="T:System.DateTimeOffset" /> object is earlier than <paramref name="other" />.
</description></item><item><term> Zero
</term><description> The current <see cref="T:System.DateTimeOffset" /> object is the same as <paramref name="other" />.
</description></item><item><term> Greater than zero.
</term><description> The current <see cref="T:System.DateTimeOffset" /> object is later than <paramref name="other" />.
</description></item></list></returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method compares <xref:System.DateTimeOffset> objects by comparing their <xref:System.DateTimeOffset.UtcDateTime%2A> 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 `other` parameter.
## Examples
The following example illustrates calls to the <xref:System.DateTimeOffset.CompareTo%2A> method to compare <xref:System.DateTimeOffset> objects.
[!code-csharp[System.DateTimeOffset.Methods#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods3.cs#8)]
[!code-vb[System.DateTimeOffset.Methods#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods3.vb#8)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Date">
<MemberSignature Language="C#" Value="public DateTime Date { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime Date" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.Date" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Date As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property DateTime Date { DateTime get(); };" />
<MemberSignature Language="F#" Value="member this.Date : DateTime" Usage="System.DateTimeOffset.Date" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.DateTime" /> value that represents the date component of the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>A <see cref="T:System.DateTime" /> value that represents the date component of the current <see cref="T:System.DateTimeOffset" /> object.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property removes any significant part of the time component from a <xref:System.DateTimeOffset> object and returns only its significant date component. For example, if the <xref:System.DateTimeOffset> object has a date and time value of "1/12/07 4:01pm +7:30", the property returns a <xref:System.DateTime> value of "1/12/07 12:00:00 AM". The <xref:System.DateTime> 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 <xref:System.DateTime.Kind%2A?displayProperty=nameWithType> property of the returned <xref:System.DateTime> object is always <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType>. It is not affected by the value of the <xref:System.DateTimeOffset.Offset%2A> 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.
## Examples
The following example retrieves the value of the <xref:System.DateTimeOffset.Date%2A> property for a specific date. It then displays that value to the console using some standard and custom date-only format specifiers.
[!code-csharp[System.DateTimeOffset.Properties#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#1)]
[!code-vb[System.DateTimeOffset.Properties#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#1)]
]]></format>
</remarks>
<related type="Article" href="~/docs/standard/base-types/standard-date-and-time-format-strings.md">Standard DateTime Format Strings</related>
<related type="Article" href="~/docs/standard/base-types/custom-date-and-time-format-strings.md">Custom DateTime Format Strings</related>
</Docs>
</Member>
<Member MemberName="DateTime">
<MemberSignature Language="C#" Value="public DateTime DateTime { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime DateTime" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.DateTime" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property DateTime As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property DateTime DateTime { DateTime get(); };" />
<MemberSignature Language="F#" Value="member this.DateTime : DateTime" Usage="System.DateTimeOffset.DateTime" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.DateTime" /> value that represents the date and time of the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>The date and time of the current <see cref="T:System.DateTimeOffset" /> object.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.DateTime%2A> property is not affected by the value of the <xref:System.DateTimeOffset.Offset%2A> property.
This property returns both the date and the time component of a <xref:System.DateTimeOffset> object, which makes it useful for performing <xref:System.DateTimeOffset> to <xref:System.DateTime> conversion. For example, if the <xref:System.DateTimeOffset> 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 <xref:System.DateTime.Kind%2A?displayProperty=nameWithType> property of the returned <xref:System.DateTime> object is <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType>.
## Examples
The following example illustrates the use of the <xref:System.DateTimeOffset.DateTime%2A> property to convert the time returned by the <xref:System.DateTimeOffset.Now%2A> and <xref:System.DateTimeOffset.UtcNow%2A> properties to <xref:System.DateTime> values.
[!code-csharp[System.DateTimeOffset.Properties#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#2)]
[!code-vb[System.DateTimeOffset.Properties#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#2)]
]]></format>
</remarks>
<altmember cref="P:System.DateTimeOffset.LocalDateTime" />
<related type="Article" href="~/docs/standard/datetime/converting-between-datetime-and-offset.md">Converting Between DateTime and DateTimeOffset</related>
</Docs>
</Member>
<Member MemberName="Day">
<MemberSignature Language="C#" Value="public int Day { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Day" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.Day" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Day As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Day { int get(); };" />
<MemberSignature Language="F#" Value="member this.Day : int" Usage="System.DateTimeOffset.Day" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the day of the month represented by the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>The day component of the current <see cref="T:System.DateTimeOffset" /> object, expressed as a value between 1 and 31.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.Day%2A> property is not affected by the value of the <xref:System.DateTimeOffset.Offset%2A> property.
You can also create a string representation of a <xref:System.DateTimeOffset> object's day component by calling the <xref:System.DateTimeOffset.ToString%2A> method with the "d" or "dd" custom format specifiers.
## Examples
The following example displays the day component of a <xref:System.DateTimeOffset> object in three different ways:
- By retrieving the value of the <xref:System.DateTimeOffset.Day%2A> property.
- By calling the <xref:System.DateTimeOffset.ToString%28System.String%29> method with the "d" format specifier.
- By calling the <xref:System.DateTimeOffset.ToString%28System.String%29> method with the "dd" format specifier.
[!code-csharp[System.DateTimeOffset.Properties#10](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#10)]
[!code-vb[System.DateTimeOffset.Properties#10](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#10)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DayOfWeek">
<MemberSignature Language="C#" Value="public DayOfWeek DayOfWeek { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.DayOfWeek DayOfWeek" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.DayOfWeek" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property DayOfWeek As DayOfWeek" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property DayOfWeek DayOfWeek { DayOfWeek get(); };" />
<MemberSignature Language="F#" Value="member this.DayOfWeek : DayOfWeek" Usage="System.DateTimeOffset.DayOfWeek" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DayOfWeek</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the day of the week represented by the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>One of the enumeration values that indicates the day of the week of the current <see cref="T:System.DateTimeOffset" /> object.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value of the constants in the <xref:System.DayOfWeek> enumeration ranges from <xref:System.DayOfWeek.Sunday?displayProperty=nameWithType> to <xref:System.DayOfWeek.Saturday?displayProperty=nameWithType>. If cast to an integer, its value ranges from zero (which indicates <xref:System.DayOfWeek.Sunday?displayProperty=nameWithType>) to six (which indicates <xref:System.DayOfWeek.Saturday?displayProperty=nameWithType>).
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-csharp[System.DateTimeOffset.Properties#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#4)]
[!code-vb[System.DateTimeOffset.Properties#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#4)]
Note that the string returned by calling the `ToString` method of the <xref:System.DayOfWeek> 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 <xref:System.DateTimeOffset.ToString%2A> 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-csharp[System.DateTimeOffset.Properties#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#5)]
[!code-vb[System.DateTimeOffset.Properties#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#5)]
## Examples
The following example displays the weekday name of the first day of each month of the year 2008.
[!code-csharp[System.DateTimeOffset.Properties#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#3)]
[!code-vb[System.DateTimeOffset.Properties#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#3)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DayOfYear">
<MemberSignature Language="C#" Value="public int DayOfYear { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 DayOfYear" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.DayOfYear" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property DayOfYear As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int DayOfYear { int get(); };" />
<MemberSignature Language="F#" Value="member this.DayOfYear : int" Usage="System.DateTimeOffset.DayOfYear" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the day of the year represented by the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>The day of the year of the current <see cref="T:System.DateTimeOffset" /> object, expressed as a value between 1 and 366.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Equals">
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Determines whether two <see cref="T:System.DateTimeOffset" /> objects are equal, or a <see cref="T:System.DateTimeOffset" /> object is equal to a specified object.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public bool Equals (DateTimeOffset other);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool Equals(valuetype System.DateTimeOffset other) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.Equals(System.DateTimeOffset)" />
<MemberSignature Language="VB.NET" Value="Public Function Equals (other As DateTimeOffset) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool Equals(DateTimeOffset other);" />
<MemberSignature Language="F#" Value="override this.Equals : DateTimeOffset -&gt; bool" Usage="dateTimeOffset.Equals other" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IEquatable`1.Equals(`0)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="other" Type="System.DateTimeOffset" />
</Parameters>
<Docs>
<param name="other">An object to compare to the current <see cref="T:System.DateTimeOffset" /> object.</param>
<summary>Determines whether the current <see cref="T:System.DateTimeOffset" /> object represents the same point in time as a specified <see cref="T:System.DateTimeOffset" /> object.</summary>
<returns>
<see langword="true" /> if both <see cref="T:System.DateTimeOffset" /> objects have the same <see cref="P:System.DateTimeOffset.UtcDateTime" /> value; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Before it performs the comparison, this method converts the values of both <xref:System.DateTimeOffset> objects to Coordinated Universal Time (UTC). The method is equivalent to the following:
[!code-csharp[System.DateTimeOffset.Syntax#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs#2)]
[!code-vb[System.DateTimeOffset.Syntax#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/vb/Syntax.vb#2)]
In other words, the <xref:System.DateTimeOffset.Equals%28System.DateTimeOffset%29> method determines whether two <xref:System.DateTimeOffset> objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two <xref:System.DateTimeOffset> objects represent the same time and have the same offset value, use the <xref:System.DateTimeOffset.EqualsExact%2A> method.
A <xref:System.DateTimeOffset> object that is not `null` is considered to be later (or greater) than one that is `null`.
This overload of the <xref:System.DateTimeOffset.Equals%28System.DateTimeOffset%29> method implements the <xref:System.IEquatable%601.Equals%2A?displayProperty=nameWithType> method. It offers slightly better performance than the <xref:System.DateTimeOffset.Equals%28System.Object%29?displayProperty=nameWithType> overload because the `other` parameter does not have to be converted from an object.
## Examples
The following example illustrates calls to the <xref:System.DateTimeOffset.Equals%28System.DateTimeOffset%29> method to test <xref:System.DateTimeOffset> objects for equality with the current <xref:System.DateTimeOffset> object.
[!code-csharp[System.DateTimeOffset.Methods#9](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs#9)]
[!code-vb[System.DateTimeOffset.Methods#9](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods.vb#9)]
]]></format>
</remarks>
<altmember cref="M:System.DateTimeOffset.EqualsExact(System.DateTimeOffset)" />
</Docs>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public override bool Equals (object obj);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object obj) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.Equals(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function Equals (obj As Object) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override bool Equals(System::Object ^ obj);" />
<MemberSignature Language="F#" Value="override this.Equals : obj -&gt; bool" Usage="dateTimeOffset.Equals obj" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="obj" Type="System.Object" />
</Parameters>
<Docs>
<param name="obj">The object to compare to the current <see cref="T:System.DateTimeOffset" /> object.</param>
<summary>Determines whether a <see cref="T:System.DateTimeOffset" /> object represents the same point in time as a specified object.</summary>
<returns>
<see langword="true" /> if the <paramref name="obj" /> parameter is a <see cref="T:System.DateTimeOffset" /> object and represents the same point in time as the current <see cref="T:System.DateTimeOffset" /> object; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Before it performs the comparison, this method converts the values of both the current <xref:System.DateTimeOffset> object and the `obj` parameter to Coordinated Universal Time (UTC). The method is equivalent to the following:
[!code-csharp[System.DateTimeOffset.Syntax#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs#3)]
[!code-vb[System.DateTimeOffset.Syntax#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/vb/Syntax.vb#3)]
In other words, the <xref:System.DateTimeOffset.Equals%28System.Object%29?displayProperty=nameWithType> method determines whether the current <xref:System.DateTimeOffset> object and a specified object represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two <xref:System.DateTimeOffset> objects represent the same time and have the same offset value, use the <xref:System.DateTimeOffset.EqualsExact%2A> method.
If `obj` is `null`, or if the run-time type of `obj` is not <xref:System.DateTimeOffset>, the method returns `false`.
## Examples
The following example indicates whether the current <xref:System.DateTimeOffset> object is equal to several other <xref:System.DateTimeOffset> objects, as well as to a null reference and a <xref:System.DateTime> object.
[!code-csharp[System.DateTimeOffset.Methods#10](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs#10)]
[!code-vb[System.DateTimeOffset.Methods#10](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods.vb#10)]
]]></format>
</remarks>
<altmember cref="M:System.DateTimeOffset.EqualsExact(System.DateTimeOffset)" />
</Docs>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public static bool Equals (DateTimeOffset first, DateTimeOffset second);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Equals(valuetype System.DateTimeOffset first, valuetype System.DateTimeOffset second) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.Equals(System.DateTimeOffset,System.DateTimeOffset)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Equals (first As DateTimeOffset, second As DateTimeOffset) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool Equals(DateTimeOffset first, DateTimeOffset second);" />
<MemberSignature Language="F#" Value="static member Equals : DateTimeOffset * DateTimeOffset -&gt; bool" Usage="System.DateTimeOffset.Equals (first, second)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="first" Type="System.DateTimeOffset" />
<Parameter Name="second" Type="System.DateTimeOffset" />
</Parameters>
<Docs>
<param name="first">The first object to compare.</param>
<param name="second">The second object to compare.</param>
<summary>Determines whether two specified <see cref="T:System.DateTimeOffset" /> objects represent the same point in time.</summary>
<returns>
<see langword="true" /> if the two <see cref="T:System.DateTimeOffset" /> objects have the same <see cref="P:System.DateTimeOffset.UtcDateTime" /> value; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Before it performs the comparison, this method converts both <xref:System.DateTimeOffset> objects to Coordinated Universal Time (UTC). The method is equivalent to the following:
[!code-csharp[System.DateTimeOffset.Syntax#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs#4)]
[!code-vb[System.DateTimeOffset.Syntax#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/vb/Syntax.vb#4)]
In other words, the <xref:System.DateTimeOffset.Equals%28System.DateTimeOffset%2CSystem.DateTimeOffset%29> method determines whether the two <xref:System.DateTimeOffset> objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two <xref:System.DateTimeOffset> objects represent the same time and have the same offset value, use the <xref:System.DateTimeOffset.EqualsExact%2A> method.
## Examples
The following example illustrates calls to the <xref:System.DateTimeOffset.Equals%28System.DateTimeOffset%2CSystem.DateTimeOffset%29> method to test various pairs of <xref:System.DateTimeOffset> objects for equality.
[!code-csharp[System.DateTimeOffset.Methods#11](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs#11)]
[!code-vb[System.DateTimeOffset.Methods#11](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods.vb#11)]
]]></format>
</remarks>
<altmember cref="M:System.DateTimeOffset.EqualsExact(System.DateTimeOffset)" />
</Docs>
</Member>
<Member MemberName="EqualsExact">
<MemberSignature Language="C#" Value="public bool EqualsExact (DateTimeOffset other);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool EqualsExact(valuetype System.DateTimeOffset other) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.EqualsExact(System.DateTimeOffset)" />
<MemberSignature Language="VB.NET" Value="Public Function EqualsExact (other As DateTimeOffset) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool EqualsExact(DateTimeOffset other);" />
<MemberSignature Language="F#" Value="member this.EqualsExact : DateTimeOffset -&gt; bool" Usage="dateTimeOffset.EqualsExact other" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="other" Type="System.DateTimeOffset" />
</Parameters>
<Docs>
<param name="other">The object to compare to the current <see cref="T:System.DateTimeOffset" /> object.</param>
<summary>Determines whether the current <see cref="T:System.DateTimeOffset" /> object represents the same time and has the same offset as a specified <see cref="T:System.DateTimeOffset" /> object.</summary>
<returns>
<see langword="true" /> if the current <see cref="T:System.DateTimeOffset" /> object and <paramref name="other" /> have the same date and time value and the same <see cref="P:System.DateTimeOffset.Offset" /> value; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Because multiple time zones share a single offset, a return value of `true` does not guarantee that the current and the `other` object represent times in the same time zone.
Unlike the <xref:System.DateTimeOffset.EqualsExact%2A> method, the overloads of the <xref:System.DateTimeOffset.Equals%2A> method determine only whether two <xref:System.DateTimeOffset> 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.
## Examples
The following example illustrates the use of the <xref:System.DateTimeOffset.EqualsExact%2A> method to compare similar <xref:System.DateTimeOffset> objects.
[!code-csharp[System.DateTimeOffset.Methods#12](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs#12)]
[!code-vb[System.DateTimeOffset.Methods#12](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/vb/Methods.vb#12)]
]]></format>
</remarks>
<altmember cref="Overload:System.DateTimeOffset.Equals" />
</Docs>
</Member>
<Member MemberName="FromFileTime">
<MemberSignature Language="C#" Value="public static DateTimeOffset FromFileTime (long fileTime);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTimeOffset FromFileTime(int64 fileTime) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.FromFileTime(System.Int64)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function FromFileTime (fileTime As Long) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static DateTimeOffset FromFileTime(long fileTime);" />
<MemberSignature Language="F#" Value="static member FromFileTime : int64 -&gt; DateTimeOffset" Usage="System.DateTimeOffset.FromFileTime fileTime" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="fileTime" Type="System.Int64" />
</Parameters>
<Docs>
<param name="fileTime">A Windows file time, expressed in ticks.</param>
<summary>Converts the specified Windows file time to an equivalent local time.</summary>
<returns>An object that represents the date and time of <paramref name="fileTime" /> with the offset set to the local time offset.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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 <xref:System.DateTimeOffset> values.
Windows file time values can also be created from <xref:System.DateTime> values by calling the <xref:System.DateTime.ToFileTime%2A?displayProperty=nameWithType> and <xref:System.DateTime.ToFileTimeUtc%2A?displayProperty=nameWithType> methods, and from <xref:System.DateTimeOffset> values by calling the <xref:System.DateTimeOffset.ToFileTime%2A?displayProperty=nameWithType> method.
## Examples
The following example uses the Windows API to retrieve the Windows file times for the WordPad executable.
[!code-csharp[System.DateTimeOffset.FromFileTime#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.FromFileTime/cs/FileTime.cs#1)]
[!code-vb[System.DateTimeOffset.FromFileTime#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.FromFileTime/vb/FileTime.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="filetime" /> is less than zero.
-or-
<paramref name="filetime" /> is greater than <see langword="DateTimeOffset.MaxValue.Ticks" />.</exception>
</Docs>
</Member>
<Member MemberName="FromUnixTimeMilliseconds">
<MemberSignature Language="C#" Value="public static DateTimeOffset FromUnixTimeMilliseconds (long milliseconds);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTimeOffset FromUnixTimeMilliseconds(int64 milliseconds) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.FromUnixTimeMilliseconds(System.Int64)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function FromUnixTimeMilliseconds (milliseconds As Long) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static DateTimeOffset FromUnixTimeMilliseconds(long milliseconds);" />
<MemberSignature Language="F#" Value="static member FromUnixTimeMilliseconds : int64 -&gt; DateTimeOffset" Usage="System.DateTimeOffset.FromUnixTimeMilliseconds milliseconds" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="milliseconds" Type="System.Int64" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="milliseconds">A Unix time, expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative.</param>
<summary>Converts a Unix time expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z to a <see cref="T:System.DateTimeOffset" /> value.</summary>
<returns>A date and time value that represents the same moment in time as the Unix time.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.Offset%2A> property value of the returned <xref:System.DateTimeOffset> instance is <xref:System.TimeSpan.Zero?displayProperty=nameWithType>, which represents Coordinated Universal Time. You can convert it to the time in a specific time zone by calling the <xref:System.TimeZoneInfo.ConvertTime%28System.DateTimeOffset%2CSystem.TimeZoneInfo%29?displayProperty=nameWithType> method.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="milliseconds" /> is less than -62,135,596,800,000.
-or-
<paramref name="milliseconds" /> is greater than 253,402,300,799,999.</exception>
<altmember cref="M:System.DateTimeOffset.FromUnixTimeSeconds(System.Int64)" />
<altmember cref="M:System.DateTimeOffset.ToUnixTimeMilliseconds" />
</Docs>
</Member>
<Member MemberName="FromUnixTimeSeconds">
<MemberSignature Language="C#" Value="public static DateTimeOffset FromUnixTimeSeconds (long seconds);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.DateTimeOffset FromUnixTimeSeconds(int64 seconds) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.FromUnixTimeSeconds(System.Int64)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function FromUnixTimeSeconds (seconds As Long) As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static DateTimeOffset FromUnixTimeSeconds(long seconds);" />
<MemberSignature Language="F#" Value="static member FromUnixTimeSeconds : int64 -&gt; DateTimeOffset" Usage="System.DateTimeOffset.FromUnixTimeSeconds seconds" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="seconds" Type="System.Int64" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="seconds">A Unix time, expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative.</param>
<summary>Converts a Unix time expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z to a <see cref="T:System.DateTimeOffset" /> value.</summary>
<returns>A date and time value that represents the same moment in time as the Unix time.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.Offset%2A> property value of the returned <xref:System.DateTimeOffset> instance is <xref:System.TimeSpan.Zero?displayProperty=nameWithType>, which represents Coordinated Universal Time. You can convert it to the time in a specific time zone by calling the <xref:System.TimeZoneInfo.ConvertTime%28System.DateTimeOffset%2CSystem.TimeZoneInfo%29?displayProperty=nameWithType> method.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="seconds" /> is less than -62,135,596,800.
-or-
<paramref name="seconds" /> is greater than 253,402,300,799.</exception>
<altmember cref="M:System.DateTimeOffset.FromUnixTimeMilliseconds(System.Int64)" />
<altmember cref="M:System.DateTimeOffset.ToUnixTimeSeconds" />
</Docs>
</Member>
<Member MemberName="GetHashCode">
<MemberSignature Language="C#" Value="public override int GetHashCode ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.GetHashCode" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetHashCode () As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetHashCode();" />
<MemberSignature Language="F#" Value="override this.GetHashCode : unit -&gt; int" Usage="dateTimeOffset.GetHashCode " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the hash code for the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<returns>A 32-bit signed integer hash code.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Hour">
<MemberSignature Language="C#" Value="public int Hour { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Hour" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.Hour" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Hour As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Hour { int get(); };" />
<MemberSignature Language="F#" Value="member this.Hour : int" Usage="System.DateTimeOffset.Hour" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the hour component of the time represented by the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>The hour component of the current <see cref="T:System.DateTimeOffset" /> object. This property uses a 24-hour clock; the value ranges from 0 to 23.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.Hour%2A> property is not affected by the value of the <xref:System.DateTimeOffset.Offset%2A> property.
You can also create a string representation of a <xref:System.DateTimeOffset> object's hour component by calling the <xref:System.DateTimeOffset.ToString%2A> method with the "H", or "HH" custom format specifiers.
## Examples
The following example displays the hour component of a <xref:System.DateTimeOffset> object in three different ways:
- By retrieving the value of the <xref:System.DateTimeOffset.Hour%2A> property.
- By calling the <xref:System.DateTimeOffset.ToString%28System.String%29> method with the "H" format specifier.
- By calling the <xref:System.DateTimeOffset.ToString%28System.String%29> method with the "HH" format specifier.
[!code-csharp[System.DateTimeOffset.Properties#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#6)]
[!code-vb[System.DateTimeOffset.Properties#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#6)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="LocalDateTime">
<MemberSignature Language="C#" Value="public DateTime LocalDateTime { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime LocalDateTime" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.LocalDateTime" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property LocalDateTime As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property DateTime LocalDateTime { DateTime get(); };" />
<MemberSignature Language="F#" Value="member this.LocalDateTime : DateTime" Usage="System.DateTimeOffset.LocalDateTime" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.DateTime" /> value that represents the local date and time of the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>The local date and time of the current <see cref="T:System.DateTimeOffset" /> object.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If necessary, the <xref:System.DateTimeOffset.LocalDateTime%2A> property converts the current <xref:System.DateTimeOffset> object's date and time to the local system's date and time. The conversion is a two-step operation:
1. The property converts the current <xref:System.DateTimeOffset> object's time to Coordinated Universal Time (UTC).
2. 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 <xref:System.DateTimeOffset> 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 <xref:System.DateTimeOffset> object, which makes it useful for <xref:System.DateTimeOffset> to <xref:System.DateTime> conversion. In addition to performing any necessary time conversion, this property differs from the <xref:System.DateTimeOffset.DateTime%2A> property by setting the value of the <xref:System.DateTime.Kind%2A> property of the returned <xref:System.DateTime> object to <xref:System.DateTimeKind.Local?displayProperty=nameWithType>.
## Examples
The following example illustrates several conversions of <xref:System.DateTimeOffset> values to local times in the U.S. Pacific Standard Time zone. Note that the last three times are all ambiguous; the property maps all of them to a single date and time in the Pacific Standard Time zone.
[!code-csharp[System.DateTimeOffset.Properties#7](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#7)]
[!code-vb[System.DateTimeOffset.Properties#7](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#7)]
]]></format>
</remarks>
<altmember cref="P:System.DateTimeOffset.DateTime" />
</Docs>
</Member>
<Member MemberName="MaxValue">
<MemberSignature Language="C#" Value="public static readonly DateTimeOffset MaxValue;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly valuetype System.DateTimeOffset MaxValue" />
<MemberSignature Language="DocId" Value="F:System.DateTimeOffset.MaxValue" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly MaxValue As DateTimeOffset " />
<MemberSignature Language="C++ CLI" Value="public: static initonly DateTimeOffset MaxValue;" />
<MemberSignature Language="F#" Value=" staticval mutable MaxValue : DateTimeOffset" Usage="System.DateTimeOffset.MaxValue" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Docs>
<summary>Represents the greatest possible value of <see cref="T:System.DateTimeOffset" />. This field is read-only.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value of this constant is 12/31/9999 11:59:59 PM +00:00.
The <xref:System.DateTimeOffset.MaxValue> property is used to determine whether the value of a new <xref:System.DateTimeOffset> object or the <xref:System.DateTimeOffset> 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 <xref:System.ArgumentOutOfRangeException>. Any <xref:System.DateTimeOffset> value is converted to Coordinated Universal Time (UTC) before the method compares it with <xref:System.DateTimeOffset.MaxValue>. This means that a <xref:System.DateTimeOffset> 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 <xref:System.DateTimeOffset.MaxValue> when it is converted to UTC.
Some calendars, such as the <xref:System.Globalization.UmAlQuraCalendar>, support an upper date range that is earlier than <xref:System.DateTime.MaxValue>. In these cases, trying to access <xref:System.DateTime.MaxValue> in variable assignments or formatting and parsing operations can throw an <xref:System.ArgumentOutOfRangeException>. Instead of retrieving the value of <xref:System.DateTime.MaxValue?displayProperty=nameWithType>, you can retrieve the value of the specified culture's latest valid date value from the <xref:System.Globalization.Calendar.MaxSupportedDateTime%2A?displayProperty=nameWithType> property.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<see cref="F:System.DateTime.MaxValue" /> is outside the range of the current or specified culture's default calendar.</exception>
</Docs>
</Member>
<Member MemberName="Millisecond">
<MemberSignature Language="C#" Value="public int Millisecond { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Millisecond" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.Millisecond" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Millisecond As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Millisecond { int get(); };" />
<MemberSignature Language="F#" Value="member this.Millisecond : int" Usage="System.DateTimeOffset.Millisecond" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the millisecond component of the time represented by the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>The millisecond component of the current <see cref="T:System.DateTimeOffset" /> object, expressed as an integer between 0 and 999.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can also create a string representation of a <xref:System.DateTimeOffset> object's millisecond component by calling the <xref:System.DateTimeOffset.ToString%2A> method with the "fff" custom format specifier.
If you rely on properties such as <xref:System.DateTimeOffset.Now%2A> or <xref:System.DateTimeOffset.UtcNow%2A> 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.
## Examples
The following example displays the number of milliseconds of a <xref:System.DateTimeOffset> object by using a custom format specifier and by directly accessing the <xref:System.DateTimeOffset.Millisecond%2A> property.
[!code-csharp[System.DateTimeOffset.Properties#12](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#12)]
[!code-vb[System.DateTimeOffset.Properties#12](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#12)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Minute">
<MemberSignature Language="C#" Value="public int Minute { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Minute" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.Minute" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Minute As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Minute { int get(); };" />
<MemberSignature Language="F#" Value="member this.Minute : int" Usage="System.DateTimeOffset.Minute" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the minute component of the time represented by the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>The minute component of the current <see cref="T:System.DateTimeOffset" /> object, expressed as an integer between 0 and 59.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.Minute%2A> property is not affected by the value of the <xref:System.DateTimeOffset.Offset%2A> property.
You can also create a string representation of a <xref:System.DateTimeOffset> object's minute component by calling the <xref:System.DateTimeOffset.ToString%2A> method with the "m", or "mm" custom format specifiers.
## Examples
The following example displays the minute component of a <xref:System.DateTimeOffset> object in three different ways:
- By retrieving the value of the <xref:System.DateTimeOffset.Minute%2A> property.
- By calling the <xref:System.DateTimeOffset.ToString%28System.String%29> method with the "m" format specifier.
- By calling the <xref:System.DateTimeOffset.ToString%28System.String%29> method with the "mm" format specifier.
[!code-csharp[System.DateTimeOffset.Properties#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#8)]
[!code-vb[System.DateTimeOffset.Properties#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#8)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="MinValue">
<MemberSignature Language="C#" Value="public static readonly DateTimeOffset MinValue;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly valuetype System.DateTimeOffset MinValue" />
<MemberSignature Language="DocId" Value="F:System.DateTimeOffset.MinValue" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly MinValue As DateTimeOffset " />
<MemberSignature Language="C++ CLI" Value="public: static initonly DateTimeOffset MinValue;" />
<MemberSignature Language="F#" Value=" staticval mutable MinValue : DateTimeOffset" Usage="System.DateTimeOffset.MinValue" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Docs>
<summary>Represents the earliest possible <see cref="T:System.DateTimeOffset" /> value. This field is read-only.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value of this constant is 1/1/0001 12:00:00 AM +00:00.
The <xref:System.DateTimeOffset.MinValue> property is used to determine whether the value of a new <xref:System.DateTimeOffset> object or the <xref:System.DateTimeOffset> 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 <xref:System.ArgumentOutOfRangeException>. Any <xref:System.DateTimeOffset> value is converted to Coordinated Universal Time (UTC) before the method performs the comparison with <xref:System.DateTimeOffset.MinValue>. This means that a <xref:System.DateTimeOffset> 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 <xref:System.DateTimeOffset.MinValue> when it is converted to UTC.
]]></format>
</remarks>
<altmember cref="Overload:System.DateTimeOffset.ParseExact" />
</Docs>
</Member>
<Member MemberName="Month">
<MemberSignature Language="C#" Value="public int Month { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Month" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.Month" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Month As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Month { int get(); };" />
<MemberSignature Language="F#" Value="member this.Month : int" Usage="System.DateTimeOffset.Month" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the month component of the date represented by the current <see cref="T:System.DateTimeOffset" /> object.</summary>
<value>The month component of the current <see cref="T:System.DateTimeOffset" /> object, expressed as an integer between 1 and 12.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.Month%2A> property is not affected by the value of the <xref:System.DateTimeOffset.Offset%2A> property.
You can also create a string representation of a <xref:System.DateTimeOffset> object's month component by calling the <xref:System.DateTimeOffset.ToString%2A> method with the "M" or "MM" custom format specifiers.
## Examples
The following example displays the month component of a <xref:System.DateTimeOffset> value in three different ways:
- By retrieving the value of the <xref:System.DateTimeOffset.Month%2A> property.
- By calling the <xref:System.DateTimeOffset.ToString%28System.String%29> method with the "M" format specifier.
- By calling the <xref:System.DateTimeOffset.ToString%28System.String%29> method with the "MM" format specifier.
[!code-csharp[System.DateTimeOffset.Properties#9](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#9)]
[!code-vb[System.DateTimeOffset.Properties#9](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#9)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Now">
<MemberSignature Language="C#" Value="public static DateTimeOffset Now { get; }" />
<MemberSignature Language="ILAsm" Value=".property valuetype System.DateTimeOffset Now" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.Now" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly Property Now As DateTimeOffset" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static property DateTimeOffset Now { DateTimeOffset get(); };" />
<MemberSignature Language="F#" Value="member this.Now : DateTimeOffset" Usage="System.DateTimeOffset.Now" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.DateTimeOffset" /> 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).</summary>
<value>A <see cref="T:System.DateTimeOffset" /> object whose date and time is the current local time and whose offset is the local time zone's offset from Coordinated Universal Time (UTC).</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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.
## Examples
The following example uses the <xref:System.DateTimeOffset.Now%2A> property to retrieve the current date and time and displays it by using each of the [standard date and time format strings](~/docs/standard/base-types/standard-date-and-time-format-strings.md) supported by the <xref:System.DateTimeOffset> type.
[!code-csharp[System.DateTimeOffset.Now#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.now/cs/now1.cs#1)]
[!code-vb[System.DateTimeOffset.Now#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.datetimeoffset.now/vb/now1.vb#1)]
The following example uses the <xref:System.DateTimeOffset.Now%2A> and <xref:System.DateTimeOffset.Millisecond%2A> properties to determine the resolution of the system clock. It displays the time only when the value of its millisecond component has changed.
[!code-csharp[System.DateTimeOffset.Properties#11](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#11)]
[!code-vb[System.DateTimeOffset.Properties#11](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#11)]
]]></format>
</remarks>
<altmember cref="P:System.DateTimeOffset.UtcNow" />
</Docs>
</Member>
<Member MemberName="Offset">
<MemberSignature Language="C#" Value="public TimeSpan Offset { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.TimeSpan Offset" />
<MemberSignature Language="DocId" Value="P:System.DateTimeOffset.Offset" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Offset As TimeSpan" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property TimeSpan Offset { TimeSpan get(); };" />
<MemberSignature Language="F#" Value="member this.Offset : TimeSpan" Usage="System.DateTimeOffset.Offset" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.TimeSpan</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the time's offset from Coordinated Universal Time (UTC).</summary>
<value>The difference between the current <see cref="T:System.DateTimeOffset" /> object's time value and Coordinated Universal Time (UTC).</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value of the <xref:System.TimeSpan.Hours%2A> property of the returned <xref:System.TimeSpan> object can range from -14 hours to 14 hours.
The value of the <xref:System.DateTimeOffset.Offset%2A> property is precise to the minute.
## Examples
The following example uses the <xref:System.DateTimeOffset.Offset%2A> property to display the local time's difference from Coordinated Universal Time (UTC).
[!code-csharp[System.DateTimeOffset.Properties#13](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs#13)]
[!code-vb[System.DateTimeOffset.Properties#13](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/vb/Properties.vb#13)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="op_Addition">
<MemberSignature Language="C#" Value="public static DateTimeOffset operator + (DateTimeOffset dateTimeOffset, TimeSpan timeSpan);" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.DateTimeOffset op_Addition(valuetype System.DateTimeOffset dateTimeOffset, valuetype System.TimeSpan timeSpan) cil managed" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.op_Addition(System.DateTimeOffset,System.TimeSpan)" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static DateTimeOffset operator +(DateTimeOffset dateTimeOffset, TimeSpan timeSpan);" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8;netcore-2.2;dotnet-uwp-10.0;netcore-3.0;netstandard-2.1" />
<MemberSignature Language="F#" Value="static member ( + ) : DateTimeOffset * TimeSpan -&gt; DateTimeOffset" Usage="dateTimeOffset + timeSpan" FrameworkAlternate="netframework-2.0;netcore-2.2;netstandard-2.1" />
<MemberSignature Language="C#" Value="public static DateTimeOffset operator + (DateTimeOffset dateTimeTz, TimeSpan timeSpan);" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname valuetype System.DateTimeOffset op_Addition(valuetype System.DateTimeOffset dateTimeTz, valuetype System.TimeSpan timeSpan) cil managed" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static DateTimeOffset operator +(DateTimeOffset dateTimeTz, TimeSpan timeSpan);" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5" />
<MemberSignature Language="F#" Value="static member ( + ) : DateTimeOffset * TimeSpan -&gt; DateTimeOffset" Usage="dateTimeTz + timeSpan" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.op_Addition(System.DateTimeOffset,System.TimeSpan)" FrameworkAlternate="netframework-2.0;dotnet-uwp-10.0" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.DateTimeOffset</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dateTimeOffset" Type="System.DateTimeOffset" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.5;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="dateTimeTz" Type="System.DateTimeOffset" Index="0" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5" />
<Parameter Name="timeSpan" Type="System.TimeSpan" Index="1" />
</Parameters>
<Docs>
<param name="dateTimeOffset">The object to add the time interval to.</param>
<param name="dateTimeTz">The object to add the time interval to.</param>
<param name="timeSpan">The time interval to add.</param>
<summary>Adds a specified time interval to a <see cref="T:System.DateTimeOffset" /> object that has a specified date and time, and yields a <see cref="T:System.DateTimeOffset" /> object that has new a date and time.</summary>
<returns>An object whose value is the sum of the values of <paramref name="dateTimeTz" /> and <paramref name="timeSpan" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.op_Addition%2A> method defines the addition operation for <xref:System.DateTimeOffset> values. It enables code such as the following:
[!code-csharp[System.DateTimeOffset.Operators#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/cs/Operators.cs#1)]
[!code-vb[System.DateTimeOffset.Operators#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/vb/Operators.vb#1)]
Languages that do not support custom operators and operator overloading can call the <xref:System.DateTimeOffset.Add%2A> method instead.
The equivalent method for this operator is <xref:System.DateTimeOffset.Add%28System.TimeSpan%29?displayProperty=nameWithType>.]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTimeOffset" /> value is less than <see cref="F:System.DateTimeOffset.MinValue" />.
-or-
The resulting <see cref="T:System.DateTimeOffset" /> value is greater than <see cref="F:System.DateTimeOffset.MaxValue" />.</exception>
<altmember cref="M:System.DateTimeOffset.Add(System.TimeSpan)" />
<related type="Article" href="~/docs/standard/datetime/performing-arithmetic-operations.md">Performing Arithmetic Operations with Dates and Times</related>
</Docs>
</Member>
<Member MemberName="op_Equality">
<MemberSignature Language="C#" Value="public static bool operator == (DateTimeOffset left, DateTimeOffset right);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Equality(valuetype System.DateTimeOffset left, valuetype System.DateTimeOffset right) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.op_Equality(System.DateTimeOffset,System.DateTimeOffset)" />
<MemberSignature Language="VB.NET" Value="Public Shared Operator == (left As DateTimeOffset, right As DateTimeOffset) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool operator ==(DateTimeOffset left, DateTimeOffset right);" />
<MemberSignature Language="F#" Value="static member ( = ) : DateTimeOffset * DateTimeOffset -&gt; bool" Usage="left = right" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="left" Type="System.DateTimeOffset" />
<Parameter Name="right" Type="System.DateTimeOffset" />
</Parameters>
<Docs>
<param name="left">The first object to compare.</param>
<param name="right">The second object to compare.</param>
<summary>Determines whether two specified <see cref="T:System.DateTimeOffset" /> objects represent the same point in time.</summary>
<returns>
<see langword="true" /> if both <see cref="T:System.DateTimeOffset" /> objects have the same <see cref="P:System.DateTimeOffset.UtcDateTime" /> value; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.op_Equality%2A> method defines the operation of the equality operator for <xref:System.DateTimeOffset> objects. It enables code such as the following:
[!code-csharp[System.DateTimeOffset.Operators#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/cs/Operators.cs#2)]
[!code-vb[System.DateTimeOffset.Operators#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/vb/Operators.vb#2)]
Before evaluating the `left` and `right` operands for equality, the operator converts both values to Coordinated Universal Time (UTC). The operation is equivalent to the following:
[!code-csharp[System.DateTimeOffset.Syntax#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs#4)]
[!code-vb[System.DateTimeOffset.Syntax#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/vb/Syntax.vb#4)]
In other words, the <xref:System.DateTimeOffset.op_Equality%2A> method determines whether the two <xref:System.DateTimeOffset> objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two <xref:System.DateTimeOffset> objects represent the same time and have the same offset value, use the <xref:System.DateTimeOffset.EqualsExact%2A> method.
The equivalent method for this operator is <xref:System.DateTimeOffset.Equals%28System.DateTimeOffset%2CSystem.DateTimeOffset%29?displayProperty=nameWithType>]]></format>
</remarks>
<altmember cref="Overload:System.DateTimeOffset.Equals" />
</Docs>
</Member>
<Member MemberName="op_GreaterThan">
<MemberSignature Language="C#" Value="public static bool operator &gt; (DateTimeOffset left, DateTimeOffset right);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_GreaterThan(valuetype System.DateTimeOffset left, valuetype System.DateTimeOffset right) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.op_GreaterThan(System.DateTimeOffset,System.DateTimeOffset)" />
<MemberSignature Language="VB.NET" Value="Public Shared Operator &gt; (left As DateTimeOffset, right As DateTimeOffset) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool operator &gt;(DateTimeOffset left, DateTimeOffset right);" />
<MemberSignature Language="F#" Value="static member ( &gt; ) : DateTimeOffset * DateTimeOffset -&gt; bool" Usage="left &gt; right" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="left" Type="System.DateTimeOffset" />
<Parameter Name="right" Type="System.DateTimeOffset" />
</Parameters>
<Docs>
<param name="left">The first object to compare.</param>
<param name="right">The second object to compare.</param>
<summary>Determines whether one specified <see cref="T:System.DateTimeOffset" /> object is greater than (or later than) a second specified <see cref="T:System.DateTimeOffset" /> object.</summary>
<returns>
<see langword="true" /> if the <see cref="P:System.DateTimeOffset.UtcDateTime" /> value of <paramref name="left" /> is later than the <see cref="P:System.DateTimeOffset.UtcDateTime" /> value of <paramref name="right" />; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.DateTimeOffset.op_GreaterThan%2A> method defines the operation of the greater than operator for <xref:System.DateTimeOffset> objects. It enables code such as the following:
[!code-csharp[System.DateTimeOffset.Operators#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/cs/Operators.cs#3)]
[!code-vb[System.DateTimeOffset.Operators#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/vb/Operators.vb#3)]
Languages that do not support custom operators can call the <xref:System.DateTimeOffset.Compare%2A> method instead. They can also call the <xref:System.DateTimeOffset.op_GreaterThan%2A> method directly, as the following example shows.
[!code-vb[System.DateTimeOffset.Operators#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/vb/Operators.vb#4)]
Before evaluating the `left` and `right` operands, the operator converts both values to Coordinated Universal Time (UTC). The operation is equivalent to the following:
[!code-csharp[System.DateTimeOffset.Syntax#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs#5)]
[!code-vb[System.DateTimeOffset.Syntax#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/vb/Syntax.vb#5)]
The equivalent method for this operator is <xref:System.DateTimeOffset.Compare%28System.DateTimeOffset%2CSystem.DateTimeOffset%29?displayProperty=nameWithType>]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="op_GreaterThanOrEqual">
<MemberSignature Language="C#" Value="public static bool operator &gt;= (DateTimeOffset left, DateTimeOffset right);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_GreaterThanOrEqual(valuetype System.DateTimeOffset left, valuetype System.DateTimeOffset right) cil managed" />
<MemberSignature Language="DocId" Value="M:System.DateTimeOffset.op_GreaterThanOrEqual(System.DateTimeOffset,System.DateTimeOffset)" />
<MemberSignature Language="VB.NET" Value="Public Shared Operator &gt;= (left As DateTimeOffset, right As DateTimeOffset) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool operator &gt;=(DateTimeOffset left, DateTimeOffset right);" />
<MemberSignature Language="F#" Value="static member ( &gt;= ) : DateTimeOffset * DateTimeOffset -&gt; bool" Usage="left &gt;= right" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="left" Type="System.DateTimeOffset" />