Created
October 18, 2015 20:22
-
-
Save appakz/00221dfb8e886a6013c7 to your computer and use it in GitHub Desktop.
Compare DateTime.Ticks with Windows File Timestamp ticks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var utcNowTicks = DateTime.UtcNow.Ticks; | |
const long fileTimestampTicks = 130892436116060259; | |
var ticksDiff = utcNowTicks - fileTimestampTicks; | |
var ticksDifTimeSpan = TimeSpan.FromTicks(ticksDiff); | |
var totalYears = ticksDifTimeSpan.TotalDays/365; | |
Console.WriteLine(totalYears); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment