﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
2967	Error in function __EventLog_DecodeTime	landfillmail@…	guinness	"The function __EventLog_DecodeTime in EventLog.au3 report a wrong date when at noon. Instead of reporting 12:00 AM the function return 00:00 AM. Maybe it's desired like that but I have search why the hour was wrong a long time :)

Code: 

{{{
Func __EventLog_DecodeTime($iEventTime)
	Local $tInt64 = DllStructCreate(""int64"")
	Local $pInt64 = DllStructGetPtr($tInt64)
	Local $tFileTime = DllStructCreate($tagFILETIME, $pInt64)
	DllStructSetData($tInt64, 1, ($iEventTime * 10000000) + 116444736000000000)
	Local $tLocalTime = _Date_Time_FileTimeToLocalFileTime($tFileTime)
	Local $tSystTime = _Date_Time_FileTimeToSystemTime($tLocalTime)
	Local $iHours = DllStructGetData($tSystTime, ""Hour"")
	Local $iMinutes = DllStructGetData($tSystTime, ""Minute"")
	Local $iSeconds = DllStructGetData($tSystTime, ""Second"")
	Local $sAMPM = ""AM""
	If $iHours > 11 Then
		$sAMPM = ""PM""
		$iHours = $iHours - 12
	EndIf
	Return StringFormat(""%02d:%02d:%02d %s"", $iHours, $iMinutes, $iSeconds, $sAMPM)
EndFunc   ;==>__EventLog_DecodeTime
}}}


I suggess to remplace with:

{{{
Func __EventLog_DecodeTime($iEventTime)
	Local $tInt64 = DllStructCreate(""int64"")
	Local $pInt64 = DllStructGetPtr($tInt64)
	Local $tFileTime = DllStructCreate($tagFILETIME, $pInt64)
	DllStructSetData($tInt64, 1, ($iEventTime * 10000000) + 116444736000000000)
	Local $tLocalTime = _Date_Time_FileTimeToLocalFileTime($tFileTime)
	Local $tSystTime = _Date_Time_FileTimeToSystemTime($tLocalTime)
	Local $iHours = DllStructGetData($tSystTime, ""Hour"")
	Local $iMinutes = DllStructGetData($tSystTime, ""Minute"")
	Local $iSeconds = DllStructGetData($tSystTime, ""Second"")
	Return StringFormat(""%02d:%02d:%02d"", $iHours, $iMinutes, $iSeconds)
EndFunc   ;==>__EventLog_DecodeTime
}}}

"	Bug	closed	3.3.13.20	AutoIt	3.3.12.0	None	Fixed	EventLog DecodeTime PM AM	
