when writing the date to the excel file, the information is recognized as text. How to set the date format first? 
for d, dirs, files in os.walk(folder): for f in files: full_name = path.join(d, f) if path.isfile(full_name): time_info = [(fn(full_name)) for fn in (path.getatime, path.getmtime, path.getctime)] dict1 = [datetime.fromtimestamp(time_info[0]).strftime('%d.%m.%Y %H:%M:%S'), datetime.fromtimestamp(time_info[0]).strftime('%d.%m.%Y %H:%M:%S')] dict2.append(dict1) df = pd.DataFrame(dict2, columns=('время последнего доступа', 'время последнего доступа')) df writer = pd.ExcelWriter('listdir1.xlsx', engine='xlsxwriter', datetime_format='dd.mm.yyyy', date_format='dd.mm.yyyy') df.to_excel(writer, index=False) writer.save() the result is the same as in my picture, i.e. excel sees information as text
