{"id":109,"date":"2017-07-18T21:16:04","date_gmt":"2017-07-18T19:16:04","guid":{"rendered":"http:\/\/developer.ps\/?p=109"},"modified":"2017-07-18T21:22:38","modified_gmt":"2017-07-18T19:22:38","slug":"python-get-files-modification-date-within-a-period-of-time","status":"publish","type":"post","link":"https:\/\/developer.ps\/index.php\/2017\/07\/18\/python-get-files-modification-date-within-a-period-of-time\/","title":{"rendered":"Python &#8211; Get files modification date within a period of time"},"content":{"rendered":"\r\n#!\/usr\/bin\/env python\r\n\r\nimport os, sys, time\r\nfrom datetime import timedelta, datetime\r\n\r\ntotalFiles1 = 0;\r\ntotalFilesSize1 = 0;\r\ntotalFiles2 = 0;\r\ntotalFilesSize2 = 0;\r\ndays = 0;\r\ndaysts = 0;\r\n\r\ndef checkModificationDates(path):\r\n    global totalFiles1, totalFilesSize1,totalFiles2, totalFilesSize2, days, daysts\r\n    totalsize1 = float();\r\n    files1 = 0;\r\n    totalsize2 = float();\r\n    files2 = 0;\r\n     \r\n    for directory, subdirectories, filenames in os.walk(path):\r\n        for filename in <a href=\"https:\/\/developer.ps\/index.php\/2017\/07\/18\/python-get-files-modification-date-within-a-period-of-time\/\" class=\"more-link\">Read more [...]<\/a>","protected":false},"excerpt":{"rendered":"<p>#!\/usr\/bin\/env python import os, sys, time from datetime import timedelta, datetime totalFiles1 = 0; totalFilesSize1 = 0; totalFiles2 = 0; totalFilesSize2 = 0; days = 0; daysts = 0; def checkModificationDates(path): global totalFiles1, totalFilesSize1,totalFiles2, totalFilesSize2, days, daysts totalsize1 = float(); files1 = 0; totalsize2 = float(); files2 = 0; for directory, subdirectories, filenames in os.walk(path): for filename in Read more [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-python"],"wps_subtitle":"Find files number and size that were modified within a period of time","_links":{"self":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":2,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/109\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}