Groups | Blog | Home
all groups > asp.net datagrid control > november 2005 >

asp.net datagrid control : Date Time question


mark
11/22/2005 1:23:23 PM
Hello

I search SQL DB and display results to an APS.Net page using <asp:repeater
/>

One of the columns is a Date in the Database SmallDate .

When I display it the page it shows Date and Time. How can I get rid of Time
and have only date displayed.

All help is greatly appreciated.

Mark

Elton Wang
11/22/2005 1:46:58 PM
If you are using DataBinder.Eval method, you can pass third parameter,
format string:

DataBinder.Eval(Container.DataItem, "DateTime_field", "{0:MMM dd yyyy}")

HTH


[quoted text, click to view]

AddThis Social Bookmark Button