time date in pandas to csv file

Solutions on MaxInterview for time date in pandas to csv file by the best coders in the world

showing results for - "time date in pandas to csv file"
Giada
19 Nov 2019
1try:
2    df.to_csv(
3             path_to_csv + f'\{file_name}_{now.strftime("%Y-%m-%d")}_to_{now.strftime("%H.%M")}.csv',
4             date_format='%Y-%m-%d %H:%M:%S', encoding='utf-8', index=False)
5except OSError as e:
6             print("Failed to create the file.......")
7             raise SystemExit(e)