Compensating time shift / Changing File Creation time using Windows Powershell

I don’t want to blame the time shift 2x a year. At least as long as I do not forget to change the time on my camera as well! As I am doing most of my photography on hikes and geo tag them afterwards, It makes quite a difference if the file creation time is right or wrong.

This year I forgot to change it on the camera and needed to bulk-change the file time later. Luckily this is pretty easy using Windows Powershell and the Windows PowerShell ISE (Integrated Scripting Environment):

$files = Get-ChildItem "C:\Users\[....]\*.arw"
foreach ($f in $files){
    $d1 = [System.IO.File]::GetCreationTime($f.FullName)
    $d2 = $d1.addHours(1)
	[System.IO.File]::SetCreationTime($f.FullName, $d2)
    echo $d1 
    echo $d2
    echo ---
}

Just copy it into the ISE, execute, done.

Leave a Reply

Your email address will not be published. Required fields are marked *