LogParser – Converting IIS logs to local date and time and filtering by date range

This is a note to myself to remember how to convert the UTC date/time to the local timezone.

logparser “SELECT TO_TIMESTAMP(date, time) AS utc-timestamp, TO_LOCALTIME(utc-timestamp) AS local-timestamp,* FROM D:\Log\SearchServiceWrapperLogs\SearchServiceWrapperLogs\u_ex1202* WHERE local-timestamp between timestamp(‘2012/02/02 00:00:00′, ‘yyyy/MM/dd hh:mm:ss’) and timestamp(‘2012/02/03 00:00:00′, ‘yyyy/MM/dd hh:mm:ss’)” -recurse:-1 -o:csv >> fulllog.csv

  • Ali

    Do you know how can I use this to convert the Globalscape EFT Server log file time stamps by any chance?

  • Sam

    I am getting syntax error while executing

    Error: detected extra argument “TO_TIMESTAMP(date, ” after query