Skip to content

Commit

Permalink
Test script
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerem Kayacan committed Apr 14, 2019
1 parent 6e31a7e commit 201a89e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from datetime import datetime
from os import scandir

def convert_date(timestamp):
d = datetime.utcfromtimestamp(timestamp)
formated_date = d.strftime('%d %b %Y')
return formated_date

def get_files():
dir_entries = scandir('D:\\home\\tmp')
for entry in dir_entries:
if entry.is_file():
info = entry.stat()
print(f'{entry.name}\t Last Modified: {convert_date(info.st_mtime)}')

get_files()

0 comments on commit 201a89e

Please sign in to comment.