Converting FileTime to DateTime

General discussion related to "Everything".
Post Reply
j2associates
Posts: 34
Joined: Wed Feb 05, 2020 12:37 pm

Converting FileTime to DateTime

Post by j2associates » Fri Aug 28, 2020 4:53 pm

To save others the time:

c#
var scientificNotationText = textFieldFromEfuFileLine;
// FileTimes are based solely on nanoseconds.
long fileTime = 0;
long.TryParse(scientificNotationText, NumberStyles.Any, CultureInfo.InvariantCulture, out fileTime);
var dateModified = DateTime.FromFileTime(fileTime);

Enjoy

NotNull
Posts: 2294
Joined: Wed May 24, 2017 9:22 pm

Re: Converting FileTime to DateTime

Post by NotNull » Fri Aug 28, 2020 5:25 pm

:thumbsup:

For non-c# ways, see also this thread.

Post Reply