{"id":508,"date":"2011-12-01T16:38:31","date_gmt":"2011-12-01T21:38:31","guid":{"rendered":"http:\/\/osric.com\/chris\/accidental-developer\/?p=508"},"modified":"2011-12-01T16:39:04","modified_gmt":"2011-12-01T21:39:04","slug":"updating-a-windows-timestamp","status":"publish","type":"post","link":"https:\/\/osric.com\/chris\/accidental-developer\/2011\/12\/updating-a-windows-timestamp\/","title":{"rendered":"Updating a Windows timestamp"},"content":{"rendered":"<p>Let&#8217;s say you need to modify the timestamp, or last modified date, on a Windows file. In my case, I wanted to change the last modified date on a lot of PDF files, so that the last modified attribute would reflect the date the <em>content<\/em> was last modified (rather than the <em>file<\/em>).<\/p>\n<p>The best and easiest way I&#8217;ve found to do this is via <a href=\"http:\/\/www.cygwin.com\/\">Cygwin<\/a>:<br \/>\n<code>touch -t 201109201145 *.pdf<\/code><\/p>\n<p>When I searched for how to accomplish this, I found all sorts of sites advising me to download a $20 shareware application, or write a C# application to do it. Fortunately, in a *nix type environment, it&#8217;s a one-line command.<\/p>\n<p>There are other ports of Unix\/Linux\/*nix commands for Windows, some of which may be more lightweight than Cygwin. (I rely on Cygwin quite a bit, so I have it installed on all my Windows machines.) I have not used any of the following, but here are links to some alternatives, in case you are interested:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.gnu.org\/software\/coreutils\/\">Core Utils<\/a><\/li>\n<li><a href=\"http:\/\/gnuwin32.sourceforge.net\/packages\/coreutils.htm\">GNU Win32 Core Utils<\/a><\/li>\n<li><a href=\"http:\/\/unxutils.sourceforge.net\/\">Unx Utils<\/a><\/li>\n<li><a href=\"http:\/\/sourceforge.net\/projects\/touchforwindows\/\">Touch for Windows<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s say you need to modify the timestamp, or last modified date, on a Windows file. In my case, I wanted to change the last modified date on a lot of PDF files, so that the last modified attribute would reflect the date the content was last modified (rather than the file). The best and &hellip; <a href=\"https:\/\/osric.com\/chris\/accidental-developer\/2011\/12\/updating-a-windows-timestamp\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Updating a Windows timestamp<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[232],"tags":[219,221,224,220,222,223],"class_list":["post-508","post","type-post","status-publish","format-standard","hentry","category-tips-tricks","tag-cygwin","tag-file-attributes","tag-modified-date","tag-timestamp","tag-touch","tag-windows"],"_links":{"self":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/comments?post=508"}],"version-history":[{"count":8,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/508\/revisions"}],"predecessor-version":[{"id":594,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/508\/revisions\/594"}],"wp:attachment":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/media?parent=508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/categories?post=508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/tags?post=508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}