I have various functions that export Excel and text files, and need to have them named with a name based on the content of some variables in the function and the time and date. How can this be done with Mathematica?
In the answer linked here, I did the following:
Then you would say
If you want to have the date in a more readable and less detailed form, you could use this for the name:
And of course, the content of any other variable could be inserted in the file name using
Here's a variation on Jens' answer:
which has the advantage of automatically padding the month and day with zeros so that the file names will sort nicely.