{"id":104,"date":"2017-07-08T12:07:39","date_gmt":"2017-07-08T10:07:39","guid":{"rendered":"http:\/\/developer.ps\/?p=104"},"modified":"2017-07-18T21:13:38","modified_gmt":"2017-07-18T19:13:38","slug":"python-script-to-extract-file-creation-dates","status":"publish","type":"post","link":"https:\/\/developer.ps\/index.php\/2017\/07\/08\/python-script-to-extract-file-creation-dates\/","title":{"rendered":"Python script to extract file Creation dates"},"content":{"rendered":"#!\/usr\/bin\/env python\r\n\r\nimport os, csv, sys, subprocess, hashlib, time, pytz\r\nfrom datetime import timedelta, datetime, tzinfo\r\nimport pytz\r\nimport tzlocal\r\n\r\nwriter = csv.writer(sys.stdout, quoting=csv.QUOTE_ALL)\r\nil = pytz.timezone('Israel')\r\nlocal_timezone = tzlocal.get_localzone() # get pytz timezone\r\nwith open('file.csv', 'w', newline='', encoding='utf-8') as csvfile:\r\n    spamwriter = csv.writer(csvfile, delimiter=',',\r\n            quotechar='\"', quoting=csv.QUOTE_MINIMAL)\r\n    for directory, <a href=\"https:\/\/developer.ps\/index.php\/2017\/07\/08\/python-script-to-extract-file-creation-dates\/\" class=\"more-link\">Read more [...]<\/a>","protected":false},"excerpt":{"rendered":"<p>#!\/usr\/bin\/env python import os, csv, sys, subprocess, hashlib, time, pytz from datetime import timedelta, datetime, tzinfo import pytz import tzlocal writer = csv.writer(sys.stdout, quoting=csv.QUOTE_ALL) il = pytz.timezone(&#8216;Israel&#8217;) local_timezone = tzlocal.get_localzone() # get pytz timezone with open(&#8216;file.csv&#8217;, &#8216;w&#8217;, newline=&#8221;, encoding=&#8217;utf-8&#8242;) as csvfile: spamwriter = csv.writer(csvfile, delimiter=&#8217;,&#8217;, quotechar='&#8221;&#8216;, quoting=csv.QUOTE_MINIMAL) for directory, 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-104","post","type-post","status-publish","format-standard","hentry","category-python"],"wps_subtitle":"Extract dates to CSV file","_links":{"self":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/104","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=104"}],"version-history":[{"count":1,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/104\/revisions\/105"}],"wp:attachment":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}