Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

time date in pandas to csv file

try:
    df.to_csv(
             path_to_csv + f'{file_name}_{now.strftime("%Y-%m-%d")}_to_{now.strftime("%H.%M")}.csv',
             date_format='%Y-%m-%d %H:%M:%S', encoding='utf-8', index=False)
except OSError as e:
             print("Failed to create the file.......")
             raise SystemExit(e)
 
PREVIOUS NEXT
Tagged: #time #date #pandas #csv #file
ADD COMMENT
Topic
Name
2+1 =