Today I used this function for the first time. Somehow, I have never needed this before. It is super simple and very useful though. It is basically the inverse of DateTime.ToString(“yyyy-mm-dd”). It allows you to parse a custom date/time format.
$provider = New-Object System.Globalization.CultureInfo "en-US" [DateTime]::ParseExact($line.date, "dd/MMM/yyyy:hh:mm:ss zz00", $provider)