Share via


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);
}

Comments

  • Anonymous
    August 02, 2004
    this is probably a stupid question but how do I convert a DateTime to a time_t ?

  • Anonymous
    January 18, 2007
    Folks may use the term "Module Timestamp" to mean both file timestamp and image header timestamp. Although

  • Anonymous
    January 17, 2009
    PingBack from http://www.hilpers.com/1145140-konvertierung-time_t-zu-datetime-und