DateTime.Unix.cs 1007 B

123456789101112131415161718192021222324252627
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System
  5. {
  6. public readonly partial struct DateTime
  7. {
  8. internal const bool s_systemSupportsLeapSeconds = false;
  9. #if !CORECLR
  10. public static DateTime UtcNow
  11. {
  12. get
  13. {
  14. return new DateTime(((ulong)(Interop.Sys.GetSystemTimeAsTicks() + UnixEpochTicks)) | KindUtc);
  15. }
  16. }
  17. #endif
  18. internal static DateTime FromFileTimeLeapSecondsAware(long fileTime) => default;
  19. internal static long ToFileTimeLeapSecondsAware(long ticks) => default;
  20. // IsValidTimeWithLeapSeconds is not expected to be called at all for now on non-Windows platforms
  21. internal static bool IsValidTimeWithLeapSeconds(int year, int month, int day, int hour, int minute, int second, DateTimeKind kind) => false;
  22. }
  23. }