From 201a89e48b64f319c6f7886e9d5e07b244e1a744 Mon Sep 17 00:00:00 2001 From: Kerem Kayacan Date: Sun, 14 Apr 2019 14:54:47 +0300 Subject: [PATCH] Test script --- src/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/main.py diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..766552f --- /dev/null +++ b/src/main.py @@ -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() \ No newline at end of file