Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DateTime Format Strings?

I have the date format string dd-mm-yy. Please can you tell me how to add hours and minutes to the string (i.e 13-03-2010.21.03) ....

DateTime.Today.ToString("dd-mm-yy") ?
like image 502
Phil Avatar asked Dec 04 '22 12:12

Phil


1 Answers

please check this http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx and http://www.csharp-examples.net/string-format-datetime/ for more information

String.Format("{0:d/M/yyyy HH:mm:ss}", datetime)
like image 69
Amr Badawy Avatar answered Jan 03 '23 04:01

Amr Badawy