What is the best way to get a list of all files in a directory, sorted by date [created | modified], using python, on a windows machine?
from pathlib import Path import os sorted(Path('./').iterdir(), key=lambda t: t.stat().st_mtime)
or
sorted(Path('./').iterdir(), key=os.path.getmtime)
sorted(os.scandir('./'), key=lambda t: t.stat().st_mtime)
where m time is modified time.