/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.Shared/Extensions/DateExtensions.cs
27 строк
542 B
Yair
Code Quality: Updated license header
31 дек 2024, 05:03
31 дек 2024, 05:03
8436c6d
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. using System; using System.Runtime.InteropServices.ComTypes; namespace Files.Shared.Extensions { public static class DateExtensions { public static DateTime ToDateTime(this FILETIME time) { uint low = (uint)time.dwLowDateTime; ulong high = (ulong)time.dwHighDateTime; long fileTime = (long)((high << 32) + low); try { return DateTime.FromFileTimeUtc(fileTime); } catch { return DateTime.FromFileTimeUtc(0xFFFFFFFF); } } } }