New mod: I'm converting the #DATE lines now as well. In the script above I was bypassing them. Don't spend too much time on my original brain-teaser because we figured out another way.
We are trying out the http://awstats.sourceforge.net/ Perl web site statistics suite for our enterprise's web site statistics. Its free and looks almost just like the one NetIQ is selling. Initially we couldn't figure out the TZ time zone variable. So we were going to convert all our logs timestamps from UTS to local time. We eventually broke down and read the awstats DOCs and figured out the TZ awstats TZ configuration thing. Now awsats is making the time conversions for us.
function ConvertIIS-LogFile
{
param( )
begin { }
process
{
$file = [System.IO.File]:

penText( $_.fullname )
while($line = $file.ReadLine())
{ if(!$line.StartsWith('#') -and ($line.Length -gt 19))
{ $UTCdatestring = $line.Substring(0, 19)
$WorkDate = Get-Date($UTCdatestring)
$LocalWorkDate = $WorkDate.tolocaltime()
$FormatLocalWorkDate = $LocalWorkDate.ToString("yyyy-MM-dd HH:mm:ss")
$StringLength = $line.length
$RestOfString = $line.substring(19,$StringLength - 19)
# $RestOfString | Out-Host
$OutString = "$FormatLocalWorkDate"+"$RestOfString"
Write-Output $OutString
}
ElseIF ($line.contains("Date:"))
{
$UTCdatestring = $line.Substring(7, 19)
$WorkDate = Get-Date($UTCdatestring)
$LocalWorkDate = $WorkDate.tolocaltime()
$FormatLocalWorkDate = $LocalWorkDate.ToString("yyyy-MM-dd HH:mm:ss")
$BeginString = $line.substring(0,6)
$StringLength = $line.length
$RestOfString = $line.substring(7+19,$StringLength - 19 -7)
# $RestOfString | Out-Host
$OutString = "$BeginString"+"$FormatLocalWorkDate"+"$RestOfString"
Write-Output $OutString
}
Else
{
Write-Output $line
}
}
}
End {}
}