Reputation: 1966
I'm trying to pass the current date and time of activities to string value so that whenever I saved my picture or anything during the program it can be saved by its own certain name + current time together but I faced error probably due to :
!
Following format would fulfill my expectation :
2019-05-22 21-33-34 instead of 2019-05-22 21:33:34.433134
import datetime as dt
import matplotlib.pyplot as plt
dtime = dt.time()
now=dt.datetime.now()
now.isoformat()
print(now)
...
plt.savefig(f'{now}.png')
...
test_RNN.to_csv(f'test_RNN_history{now}.csv', sep=',', header=None, index=None)
Upvotes: 0
Views: 350