I recently used an XML query in Powershell that looked like this:

The query was used to filter events from the event log that occurred within the last 24 hours.  However I needed to change this 7 days.  The unit of time is milliseconds but I wanted to make sure I had it exactly correct, so I checked it using the following commands:

This was my first command to check that I was using the right units of time.  This command returned:

So I could confirm that milliseconds was the right unit of time – and you can see that 86400000 matches the 24 hour time difference I use in my XML query above.  So I wanted to confirm what 7 days would be:

So I could see that the number I needed to use in my query for a time difference of 7 days was 604800000.  So my new XML query would be: