I want to specify the date of the desired format as a file name in this way ;
During [2019-10-01 09:00 ~ 2019-10-02 08:59:59] Save data to 191001-09.txt
I have no idea about this. I could only follow simple code. Please let me know how to fix it :
def timeStamped (fname, fmt = '19% m% d-% H {fname} '):
return datetime.datetime.now (). strftime (fmt) .format (fname = fname)
with open (timeStamped ('. txt'), 'a') as f_last:
f_last.write ('data')