import os, datetime path='C:\\FME' to_ext='*.xls' for file_name in os.listdir(path): root, ext = os.path.splitext(file_name) t = os.path.getmtime(file_name) v = datetime.datetime.fromtimestamp(t) x = v.strftime( ' %d-%m-%Y') os.rename(os.path.join(path, file_name), os.path.join(path, root+x+to_ext))
I would appreciate any help.
Thanks