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

Hi,
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:

https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings

Thanks