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?
For completeness with os.scandir (2x faster over pathlib):
os.scandir
pathlib
import os sorted(os.scandir('/tmp/test'), key=lambda d: d.stat().st_mtime)