Formatting DateTime inside a GridView
(Another snippet I originally posted to CodeKeep.)
Format a datetime value within a gridview’s boundfield control. The default shows MM/dd/yyyy hh:mm:ss. In my case, I didn’t want/need the time portion. So…
<asp:BoundField DataField="timestamp" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Date entered" />
Reference:
http://forums.microsoft.com/hongkong/ShowPost.aspx?PostID=4003043&SiteID=82
