Hi,
Set the DataFormatString property to whichever format you need. See the
BoundColumn.DataFormatString property topic for details:
http://msdn.microsoft.com/library/en...tringTopic.asp
See Formatting Overview (specifically the link to "Custom DateTime format
strings") to get more info on formatting:
http://msdn.microsoft.com/library/en...ngoverview.asp
Example:
<asp:BoundColumn HeaderText="Date" DataField="InsertDate"
DataFormatString="{0:ddd, dd MMM yyyy, HH:mm}"
SortExpression="InsertDate" ItemStyle-Width="150" />
for today, supposing the Thread.CurrentCulture is "en-??" will display
Tue, 12 Oct 2004, 12:55
Hope this helps
Martin
"Kenneth Keeley" <ke*******@hotmail.com> wrote in message
news:#x**************@TK2MSFTNGP11.phx.gbl...
Hi,
I am reading in results from an SQL database one of the fields is a date
value. I wish to be able to display the date as only "dd/mm/yyyy" can some
body give me an example. Here is the code I am using at the moment.
<asp:BoundColumn HeaderText="Date" DataField="InsertDate"
SortExpression="InsertDate" ItemStyle-Width="150" />
Thanks
Kenneth