SetFile is deprecated. According to the man page:
Tools supporting Carbon development, including /usr/bin/SetFile, were deprecated with Xcode 6.
But it’s not hard with AppleScript, especially if you’re running 10.11 or later:
use AppleScript version "2.5" -- El Capitan or later use framework "Foundation" use scripting additions tell application "Finder" set theSelection to selection as alias list end tell repeat with aFile in theSelection set theURL to (current application's |NSURL|'s fileURLWithPath:(POSIX path of aFile)) (theURL's setResourceValue:(current date) forKey:(current application's NSURLContentModificationDateKey) |error|:(missing value)) end repeat
NSURLCreationDateKey instead for creation date.