Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using exiftool to fix dates
ls `
| select -property @{Name='DateTimeOriginal'; Expression={(exiftool -datetimeoriginal $_).substring(34)}}, fullname `
| where {$_.DateTimeOriginal -like '2017*'} `
| %{& exiftool -datetimeoriginal="$_.DateTimeOriginal.Replace('2017','2018')" $_.fullname}
ls | select-object -property @{Name='DateTimeOriginal'; Expression={(exiftool -datetimeoriginal $_)}}, fullname | where {$_.DateTimeOriginal -like '*2017*'} | %{& exiftool -AllDates"+=1:0:0 0" $_.fullname}
ls | where {$_.name -notlike '*_original'} | select-object -property @{Name='DateTimeOriginal'; Expression={(exiftool -datetimeoriginal $_)}}, fullname | where {$_.DateTimeOriginal -like '*2017*'} | %{& exiftool -AllDates"+=1:0:0 0" $_.fullname}
ls | where {$_.name -notlike '*_original'} | select-object -property @{Name='DateTimeOriginal'; Expression={(exiftool -datetimeoriginal $_)}}, fullname | where {$_.DateTimeOriginal -like '*2017*'} | %{& exiftool -datetimeoriginal"+=1:0:0 0" -createdate"+=1:0:0 0" -modifydate"+=1:0:0 0" $_.fullname}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment