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?
In python 3.5+
from pathlib import Path sorted(Path('.').iterdir(), key=lambda f: f.stat().st_mtime)