There are lots of ideas about this topic but this one is about Win32/WinEventProc's dwmsEventTime.
MSDN http://msdn.microsoft.com/en-us/library/windows/desktop/dd373885(v=vs.85).aspx states that it's the event time in milliseconds but no further explanations provided. Milliseconds from where?
Here is the sample value returned by that event:
dwmsEventTime: 1209382650
DateTime.Now: 05/21/2014 16:49:37 (this should be very close to dwmsEventTime)
Does anyone know how to convert this parameter to .NET DateTime()?
You might try something like:
static DateTime GetDateTimeFromMillisecondNumber(int millisecCount)
{
return DateTime.Now.AddMilliseconds(millisecCount - Environment.TickCount);
}
But be aware that if the system was rebootet since the millisecCount
was obtained, this returns rubbish. The same if this is run on a different machine from the one that you obtained the count from.
Also, this is only correct "modulo 49.7 days", i.e. the correct date and time might be an integral multiple of 49.7 days greater or less than what my method returns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With