I want to add a timestamp to filenames as files are created but most of the DateTime methods I\'ve tried output something with spaces and slashes. For instance:
Personally I like it this way:
DateTime.Now.ToString("yyyy-MM-dd HH.mm.ss")
Because it distinguishes between the date and the time.
I would use the ISO 8601 format, without separators:
DateTime.Now.ToString("yyyyMMddTHHmmss")