Converting FileTime to DateTime

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

Converting FileTime to DateTime

Post by j2associates »

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: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Converting FileTime to DateTime

Post by NotNull »

:thumbsup:

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