/
DateTime.Unix.cs
31 lines (24 loc) · 1 KB
/
DateTime.Unix.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System
{
public readonly partial struct DateTime
{
internal static bool SystemSupportsLeapSeconds => false;
public static DateTime UtcNow
{
get
{
return new DateTime(((ulong)(Interop.Sys.GetSystemTimeAsTicks() + UnixEpochTicks)) | KindUtc);
}
}
#pragma warning disable IDE0060
// Never called
private static DateTime FromFileTimeLeapSecondsAware(ulong fileTime) => default;
// Never called
private static ulong ToFileTimeLeapSecondsAware(long ticks) => default;
// IsValidTimeWithLeapSeconds is not expected to be called at all for now on non-Windows platforms
internal static bool IsValidTimeWithLeapSeconds(int year, int month, int day, int hour, int minute, DateTimeKind kind) => false;
#pragma warning restore IDE0060
}
}