Format DateTime in C# to append to file name
.net, c#
Solution
DateTime.Now.ToString("dd-MM-yyyy-hh-mm-ss")
More info here
Problem
I need to format current DateTime in this format dd-mm-yyyy-hh-mm-ss and don't know how to do it. I read on Internet and then write this code: ``` DateTime saveNow = DateTime.Now; MessageBox.Show(String.Format("{0:u}", saveNow)); ``` But this returns the date on this format: ``` 2013-04-24 23:11:34Z ``` Can any help me? I need the first format to append to a file name I'm creating.