{"id":9270,"date":"2022-03-15T20:18:39","date_gmt":"2022-03-15T20:18:39","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=9270"},"modified":"2022-03-15T20:18:39","modified_gmt":"2022-03-15T20:18:39","slug":"use-powershell-to-change-file-date-time-stamps","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/use-powershell-to-change-file-date-time-stamps\/","title":{"rendered":"Use Powershell to change file date\/time stamps"},"content":{"rendered":"<p>Ever wanted to change the creation date\/time on a file on Windows &#8211; Powershell offers the following (change Filename.ext to your filename)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$(Get-Item Filename.ext).creationtime\r\n$(Get-Item Filename.ext).lastwritetime\r\n$(Get-Item Filename.ext).lastaccesstime\r\n<\/pre>\n<p>Want to change these? You can supply the date in a string like this<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$(Get-Item Filename.ext).creationtime = &quot;15 March 2022 19:00:00&quot;\r\n$(Get-Item Filename.ext).lastwritetime = &quot;15 March 2022 19:00:00&quot;\r\n$(Get-Item Filename.ext).lastaccesstime = &quot;15 March 2022 19:00:00&quot;\r\n<\/pre>\n<p>or if you like you&#8217;ve got<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$(Get-Item Filename.ext).creationtime = $(Get-Date)\r\n$(Get-Item Filename.ext).creationtime = $(Get-Date &quot;15\/03\/2022 19:00:00&quot;)\r\n<\/pre>\n<p><em>Note: I&#8217;m on a en-GB machine hence using dd\/MM\/yyyy format &#8211; ofcourse changes this to your culture format.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever wanted to change the creation date\/time on a file on Windows &#8211; Powershell offers the following (change Filename.ext to your filename) $(Get-Item Filename.ext).creationtime $(Get-Item Filename.ext).lastwritetime $(Get-Item Filename.ext).lastaccesstime Want to change these? You can supply the date in a string like this $(Get-Item Filename.ext).creationtime = &quot;15 March 2022 19:00:00&quot; $(Get-Item Filename.ext).lastwritetime = &quot;15 March 2022 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[118],"tags":[],"class_list":["post-9270","post","type-post","status-publish","format-standard","hentry","category-powershell"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=9270"}],"version-history":[{"count":4,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9270\/revisions"}],"predecessor-version":[{"id":9277,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9270\/revisions\/9277"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=9270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=9270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=9270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}