DateTimeOffset Constructor (Int64, TimeSpan)
Initializes a new instance of the DateTimeOffset structure using the specified number of ticks and offset.
Assembly: mscorlib (in mscorlib.dll)
offset is not specified in whole minutes.
ticks is less than DateTimeOffset.MinValue.Ticks or greater than DateTimeOffset.MaxValue.Ticks.
Offset s less than -14 hours or greater than 14 hours.
Ordinarily, trying to call the DateTimeOffset constructor to instantiate a DateTimeOffset value with a local time and an offset other than that of the local time zone throws an ArgumentException. You can use this overload of the DateTimeOffset constructor to work around this limitation. The following example uses the local time's number of ticks to instantiate a DateTimeOffset value whose offset does not necessarily represent that of the local time:
The following example initializes a 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.
.NET FrameworkSupported in: 4.5.2, 4.5.1, 4.5, 4, 3.5 SP1, 3.0 SP1, 2.0 SP1
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
.NET for Windows Phone appsSupported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.