I would like to access the field called Date and time from Event Viewer through Java. I managed to get the EventID :
EVENTLOGRECORD record = new EVENTLOGRECORD(pevlr);
if (record.EventID.shortValue() == 4624) {
System.out.println("Successful log in: " + " Event ID: " + record.EventID.shortValue());
}
if (record.EventID.shortValue() == 4634) {
System.out.println("Successful log out: " + " Event ID: " + record.EventID.shortValue());
}
And now the next step would be to get the Date and time
If anyone could help i would really appreciate it !
Meanwhile I figured out how to get the Date and time field. Just used :
long timestamp = record.TimeGenerated.longValue() * 1000;
Date d = new Date(timestamp);