DateTimeOffset.FromUnixTimeMilliseconds(Int64) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Converts a Unix time expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z to a DateTimeOffset value.
public:
static DateTimeOffset FromUnixTimeMilliseconds(long milliseconds);
public static DateTimeOffset FromUnixTimeMilliseconds (long milliseconds);
static member FromUnixTimeMilliseconds : int64 -> DateTimeOffset
Public Shared Function FromUnixTimeMilliseconds (milliseconds As Long) As DateTimeOffset
- milliseconds
- Int64
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.
A date and time value that represents the same moment in time as the Unix time.
milliseconds
is less than -62,135,596,800,000.
-or-
milliseconds
is greater than 253,402,300,799,999.
The Offset property value of the returned DateTimeOffset instance is TimeSpan.Zero, which represents Coordinated Universal Time. You can convert it to the time in a specific time zone by calling the TimeZoneInfo.ConvertTime(DateTimeOffset, TimeZoneInfo) method.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: