/ Published in: C#
Tentative source shows conversion to/from microseconds.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
const double MicrosecondsInAMillisecond = 1e3; public static ulong ToHawkTime(this DateTime value) { double d = (value - UnixEpoch).TotalMilliseconds * MicrosecondsInAMillisecond; return (ulong) d; } public static DateTime ConvertFromHawkTime(this ulong value) { DateTime d = UnixEpoch + TimeSpan.FromMilliseconds(value/MicrosecondsInAMillisecond); return d; }
URL: http://blogs.msdn.com/brada/archive/2004/03/20/93332.aspx