Fix File Creation date set to 24 January 1984 9:00:00 AM with Powershell
Issue
Some or your file have a creation date of 24 January 1984 9:00:00 AM.
Why is that
This date is displayed when there is actually no creation date set for the file or folder.
This could cause issues on MacOS : You won’t be able to browse a folder that has no creation date.
Solution
Make sure you have a backup
COME ON !!!!!!!!
Some checks first
Make sure the date format matches your system setup.
Check for files or folders with no creation date in a specific folder
Get-ChildItem -force "C:\Temp" | Where-Object {$_.CreationTime -eq "1/24/1984 9:00:00 AM"} | Select-Object Name, CreationTime, LastWriteTime, LastAccessTime
Check for files and folders with no creation date in a specific folder and sub-folders
Get-ChildItem -force "C:\Temp" -recurse | Where-Object {$_.CreationTime -eq "1/24/1984 9:00:00 AM"} | Select-Object Name, CreationTime, LastWriteTime, LastAccessTime
The fix
Set the creation date as last modified date and time for files and folders.
Get-ChildItem -force "C:\Temp" | Where-Object {$_.CreationTime -eq "1/24/1984 9:00:00 AM"} | ForEach-Object -Process {$_.CreationTime = $_.LastWriteTime}
Set the creation date as last modified date and time for files, folders and sub-folders.
Get-ChildItem -force "C:\Temp" -recurse | Where-Object {$_.CreationTime -eq "1/24/1984 9:00:00 AM"} | ForEach-Object -Process {$_.CreationTime = $_.LastWriteTime}
Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.