Converting to a DateTime from time_t
Sponsored By
Oo! Good stuff…I need a copy for myself…
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);
}
[Brad Abrams]
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.



About Newsletter
Comments are closed.