modify date column
If you have a date column in your gridview that displays like:
9/27/2011 9:00:35 AM
And would rather have it displayed like in the MM-DD-YYYY format instead, how do you set that up in the grid so that displays in the format that you want it to.
Thanks once again
98783 Points
9691 Posts
Moderator
Sorry I found the answer to this question already:
Re: DateTime Format in gridview colum
Jun 21, 2006 12:22 PM|LINK
Sure, if you're using a BoundField, simply do as follows:
<asp:boundfield datafield="Your_Date_Column" dataformatstring="{0:MMMM d, yyyy}" htmlencode="false" /> Just make sure you set the HtmlEncode attribute to False or it won't work.
Last edited by vbboyd; July 9th, 2013 at 04:30 PM..
|