Converting to a DateTime from time_t

This code just went by an internal alias and I thought i'd record it here.

public static DateTime Time_T2DateTime(uint time_t)
{
    long win32FileTime = 10000000*(long)time_t + 116444736000000000;
    return
DateTime.FromFileTimeUtc(win32FileTime);
}

 

Published 30 July 03 06:45 by BradA
Filed under:

Comments

# bg said on August 3, 2004 7:16 AM:
this is probably a stupid question but how do I convert a DateTime to a time_t ?

# Mike Stall's .NET Debugging Blog said on January 18, 2007 11:00 PM:

Folks may use the term "Module Timestamp" to mean both file timestamp and image header timestamp. Although

New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker