forked from dotnet/corert
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move DateTime for Unix to shared partition (dotnet/coreclr#22383)
* Move DateTime for Unix to shared partition * Keep CoreCLR specific implementation Signed-off-by: dotnet-bot <[email protected]>
- Loading branch information
1 parent
e01e2c8
commit a6d363c
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace System | ||
{ | ||
public readonly partial struct DateTime | ||
{ | ||
internal const bool s_systemSupportsLeapSeconds = false; | ||
|
||
#if !CORECLR | ||
public static DateTime UtcNow | ||
{ | ||
get | ||
{ | ||
return new DateTime(((ulong)(Interop.Sys.GetSystemTimeAsTicks() + UnixEpochTicks)) | KindUtc); | ||
} | ||
} | ||
#endif | ||
|
||
internal static DateTime FromFileTimeLeapSecondsAware(long fileTime) => default; | ||
internal static long 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, int second, DateTimeKind kind) => false; | ||
} | ||
} |