Created
December 21, 2018 20:25
-
-
Save seth10/cdd815d7c1bb70909fd97fef55462640 to your computer and use it in GitHub Desktop.
A bash function to set the "Date Created" of a file to the macOS/Finder "Date Added"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SetDateCreatedToDateAdded () { SetFile -d "$(date -j -f '%Y-%m-%d %H:%M:%S' "$(mdls $1 | grep -w kMDItemDateAdded | awk '{print $3,$4}')" +"%m/%d/%Y %H:%M:%S")" $1; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment