How can i append the date and timestamp (including milliseconds) in excel file name

I have code where i have to read emails and put the data into excel file. I am naming excel file with datetime (without milliseconds). But it is overwriting the file because process is completing within seconds, How can i also add ms in my excel name. Below is the current format

filePath + fileName + “_” +DateTime.Now.ToString(“yyyyMMddHHmmss”)+”.xlsx"

Add “fff” to the end of your datetime format string.

More is found in the documentation: