How to Convert Date and Time field in IIS log from UTC to Local Server Time
Published Mar 14 2019 10:23 AM 12.8K Views

The default IIS Logging is very neat, especially the W3C format with custom fields that give you added flexibility. However, the W3C format dictates that the date and time field be in UTC (GMT) which can be cumbersome while sniffing through the logs. Here we will show an easy way of converting the UTC field to your local time zone.


To convert IIS date and time field from UTC to your local time zone, we will be using an easy to use tool called LogParsar which you can download from here.


Once downloaded and installed, you can open-up a command window in Administrative mode and run following query (we are using the default paths here which you need to change accordingly):


"C:\Program Files (x86)\Log Parser 2.2\LogParser.exe" -i:IISW3C "select CS-URI-stem as URL, time-taken as TIME-TAKEN-(Milliscond), time as UTC, TO_Time(sub(time,timestamp('05:00:00','hh:mm:ss'))) AS EST,TO_Time(sub(time,timestamp('06:00:00','hh:mm:ss'))) AS CST,TO_Time(sub(time,timestamp('07:00:00','hh:mm:ss'))) AS MST,TO_Time(sub(time,timestamp('08:00:00','hh:mm:ss'))) AS PST from 'C:\inetpub\logs\LogFiles\W3SVC1\u_YourIISLogFileGoesHere.log' order by time-taken DESC" -rtp:-1


This will convert the UTC to several different North Amerian timezones. If you need a different timezone, just replace the hourly difference in the sub function above.


Note: The W3C Extended Log File Format is defined in the W3C Working Draft WD- logfile-960323 specification by Phillip M. Hallam-Baker and Brian Behlendorf. This document defines the Date and Time fields be always in GMT. This behavior is by design.

1 Comment
Version history
Last update:
‎Mar 14 2019 03:52 PM
Updated by: