{"id":94665,"date":"2016-11-08T07:00:00","date_gmt":"2016-11-08T22:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=94665"},"modified":"2019-03-13T10:33:29","modified_gmt":"2019-03-13T17:33:29","slug":"20161108-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20161108-00\/?p=94665","title":{"rendered":"Why do my file creation, access, or modified time disappear if I set it to midnight on January 1, 1980?"},"content":{"rendered":"<p>A customer discovered that if their program used the <code>Set&shy;File&shy;Time<\/code> function to set a network file&#8217;s creation, access, or modified time to the specific value of &#8220;midnight on January 1, 1980&#8221;, then the corresponding timestamp is removed. What&#8217;s up with that? <\/p>\n<p>As you may recall, midnight on January 1, 1980 is <a HREF=\"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/20051028-29\/?p=33573\/\">a special sentinel value<\/a>: It is the epoch for the MS-DOS time\/date format. <\/p>\n<p>At this point, I believe the responsible thing to do is to speculate irresponsibly. <\/p>\n<p>It appears that the network server they are using is trying very hard to accommodate MS-DOS clients. In particular, if somebody tries to set a file timestamp to midnight January 1, 1980, the server assumes that the client is trying to clear the timestamp. <\/p>\n<p>Explorer is one of those accommodating programs. If it sees a file whose timestamp is exactly January 1, 1980 at midnight, then it assumes that the timestamp came from a FAT filesystem (possibly tunnelled through other file systems along the way, like a network redirector), and treats it as equivalent to a missing timestamp. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mind the epoch.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-94665","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>Mind the epoch.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/94665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=94665"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/94665\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=94665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=94665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=94665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}