{"id":1048,"date":"2025-09-02T05:23:00","date_gmt":"2025-09-01T20:23:00","guid":{"rendered":"https:\/\/touhyo.com\/blog\/?p=1048"},"modified":"2025-10-21T22:49:55","modified_gmt":"2025-10-21T13:49:55","slug":"change-file-creation-date","status":"publish","type":"post","link":"https:\/\/touhyo.com\/blog\/en\/change-file-creation-date\/","title":{"rendered":"Change file creation date"},"content":{"rendered":"\n<p>Here&#8217;s how to adjust the creation or modification date of files on a Mac. The operation is completed in Terminal. Use the app located at \u201cApplications &gt; Utilities &gt; Terminal\u201d.<\/p>\n\n\n\n<p>For example, enter the following command and press Enter to force overwrite the modification date of &#8220;file.png&#8221; on your desktop to &#8220;September 2, 2025, 11:52 PM&#8221;.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki material-theme-lighter\" style=\"background-color: #FAFAFA\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E2931D\">touch<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #91B859\">-t<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #F76D47\">202509022352.00<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #91B859\">~\/Desktop\/file.png<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Next is the creation date. Note that changing the creation date requires the Xcode command-line tools to be installed. If they are installed, you can change it.<\/p>\n\n\n\n<p>If it is not yet installed, enter the following command.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki material-theme-lighter\" style=\"background-color: #FAFAFA\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E2931D\">xcode-select<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #91B859\">--install<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>If you run the above code and see the following output, it is already installed.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">error: command line tools are already installed, use &quot;Software Update&quot; to install updates<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>You can also check whether it is installed correctly using the following command.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki material-theme-lighter\" style=\"background-color: #FAFAFA\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6182B8\">which<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #91B859\">SetFile<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>If the Xcode command-line tools are already installed, the following will be displayed.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">\/usr\/bin\/SetFile<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Finally, the command to change the &#8220;Creation Date&#8221; is as follows.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki material-theme-lighter\" style=\"background-color: #FAFAFA\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E2931D\">SetFile<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #91B859\">-d<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #39ADB5\">&#39;<\/span><span style=\"color: #91B859\">09\/02\/2025 23:48:00<\/span><span style=\"color: #39ADB5\">&#39;<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #91B859\">~\/Desktop\/file.png<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>If executed, the creation date will be overwritten to &#8220;September 2, 2025, 11:48 PM&#8221;.<\/p>\n\n\n\n<p>By the way, you can check permissions below.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki material-theme-lighter\" style=\"background-color: #FAFAFA\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E2931D\">ls<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #91B859\">-l<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #91B859\">~\/Desktop<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #39ADB5\">|<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #E2931D\">grep<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #91B859\">file.png<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Access permissions, last modified time, and approximately 5.00MB in size.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki monokai\" style=\"background-color: #272822\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F8F8F2\">-rw-r--r--@  1 Taro  staff  5231632  9  2 23:52 file.png<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Please refer to this when adjusting file creation or modification dates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s how to adjust the creation or modification date of files on a Mac. The operation is completed in Terminal. Use the app located at \u201cApplications &gt; Utilities &gt; Terminal\u201d. For example, enter the following command and press Enter to force overwrite the modification date of &#8220;file.png&#8221; on your desktop to &#8220;September 2, 2025, 11:52 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/touhyo.com\/blog\/?p=1039","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1048","post","type-post","status-publish","format-standard","hentry","category-memo","en-US"],"_links":{"self":[{"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/posts\/1048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/comments?post=1048"}],"version-history":[{"count":6,"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/posts\/1048\/revisions"}],"predecessor-version":[{"id":1361,"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/posts\/1048\/revisions\/1361"}],"wp:attachment":[{"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/media?parent=1048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/categories?post=1048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touhyo.com\/blog\/wp-json\/wp\/v2\/tags?post=1048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}