Date in the filename


#1

¿How I can aggregate the current date (year and month) to the filename automatically?

Thanks in advance.


#2

You can use something like this in the file name,

“data-”+DateTime.Now.ToString(“yyyyMMddHHmmss”)+".xlsx"

or this for only year and month,

“data-”+DateTime.Now.ToString(“yyyyMM”)+".xlsx"

Thanks,
Rammohan B.


#3

Thank you very much Rammohan91.