Converting Ticks to Date and Time (Part 2)

In the previous tip we explained how you convert date and time displayed as ticks to a true DateTime format. However, there are two different time formats involving ticks, and here is an overview of how you can convert numeric datetime information:

FromFileTime() simply adds 1601 years (the calculated difference is a little off due to leap years). Some parts of Windows (like Active Directory) start their calendar at Jan 1, 1601. For these, use FromFileTime() to get the accurate date and time.