{"id":91881,"date":"2015-10-30T07:00:00","date_gmt":"2015-10-30T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/20151030-00\/?p=91881\/"},"modified":"2019-03-13T12:21:13","modified_gmt":"2019-03-13T19:21:13","slug":"20151030-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20151030-00\/?p=91881","title":{"rendered":"Why does the timestamp of a file increase by up to 2 seconds when I put it in a ZIP archive, then extract it?"},"content":{"rendered":"<p>We saw some time ago that <a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2014\/09\/03\/10554551.aspx\">the timestamp of a file increases by up to 2 seconds when you copy it to a USB thumb drive<\/a>. The underlying reason is that USB thumb drives tend to be formatted with the FAT file system, and <a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2004\/02\/26\/80492.aspx\">the FAT file system records timestamps in local time to only two-second resolution<\/a>. <\/p>\n<p>The same logic applies to ZIP archives. The ZIP archive format records file times in MS-DOS format, so it too is subject to the two-second resolution limitation. <\/p>\n<p>And the reason the time <i>increases<\/i> to the nearest two-second interval rather than rounding is so that files do not go backward in time. This is useful when you freshen a ZIP archive: If the file time went backward, then the freshen operation would always report that there were files that needed to be updated. <\/p>\n<p>From the point of view of time stamps, the ZIP archive acts like a tiny FAT-formatted USB thumb drive. <\/p>\n<p><b>Bonus chatter<\/b>: If you want to copy files whose timestamps are newer, but take into account MS-DOS timestamp rounding, you can use the <code>robocopy<\/code> command with the <code>\/FFT<\/code> command line options. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The MS-DOS time format again.<\/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-91881","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>The MS-DOS time format again.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/91881","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=91881"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/91881\/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=91881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=91881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=91881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}