Question

I've searched for several examples to analyze IIS logs using the Log Parser, taking time into account... For example, this query that shows the number of hits per hour:

SELECT 
QUANTIZE(TO_LOCALTIME(TO_TIMESTAMP(date, time)), 3600) AS Hour, 
COUNT(*) AS Hits 
FROM D:\Logs\*.log 
Group By Hour

However I cannot understand why use "TO_LOCALTIME"... Also, if there is a time difference (and a difference in results while using "TO_LOCALTIME" or not), how is that?... Thank you!

Était-ce utile?

La solution

All IIS uses UTC for all times in its logs regardless of the time zone of the server, so to get your local time, you can use TO_LOCALTIME.

I guess if you are fine with UTC, you don't need to use TO_LOCALTIME.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top