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