I have a tool that creates a plt.plot depending on two variables (te = 2022-09-09 00:00:00; datetime). How can I use this variable in the Name of an Output pdf. I also need to store it in a specific folder. My code is: plt.plot(yyf['Date'], yyf["MA"], color='#003A57', label='Correlation') plt.savefig( r'O:\FT\InvResearch\AAT\Team\Internal\Teammitglieder\Studenten\BeZi\Aufgaben\Python\KorrelMat_RA\Output\Output.pdf', format='pdf') Any help would be much appreciated!