-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kerem Kayacan
committed
Apr 14, 2019
1 parent
6e31a7e
commit 201a89e
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |