Mark
Mark

Reputation: 2760

Date format in ASP.NET

how to change the date time format 2011-09-01 09:39:23 to 2011-Aug-01 09:39:23 in asp.net.

And While displaying it should display the second format.

Upvotes: 1

Views: 209

Answers (1)

Justin Niessner
Justin Niessner

Reputation: 245399

Use one of the DateTime Format Strings with DateTime.ToString()

In particular, you will want:

yourDateTime.ToString("yyyy-MMM-dd hh:mm:ss");

Upvotes: 4

Related Questions