More corelib cleanup (dotnet/coreclr#26993)
[mono-project.git] / netcore / System.Private.CoreLib / shared / Interop / Windows / Kernel32 / Interop.FILE_TIME.cs
blob6a6464c4c8e106ea898fb6b224cbd320dfc50593
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.
5 using System;
7 internal static partial class Interop
9 internal static partial class Kernel32
11 internal struct FILE_TIME
13 internal uint dwLowDateTime;
14 internal uint dwHighDateTime;
16 internal FILE_TIME(long fileTime)
18 dwLowDateTime = (uint)fileTime;
19 dwHighDateTime = (uint)(fileTime >> 32);
22 internal long ToTicks() => ((long)dwHighDateTime << 32) + dwLowDateTime;
23 internal DateTime ToDateTimeUtc() => DateTime.FromFileTimeUtc(ToTicks());
24 internal DateTimeOffset ToDateTimeOffset() => DateTimeOffset.FromFileTime(ToTicks());