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.
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());