Newbie Question: Formatting a date item in a repeater?

D

DC

As part of a access based page writtenin c#

<td> <%# DataBinder.Eval(Container.DataItem, "SeminarDate") %> </td>

renders the Seminardate as things like "16/05/2005 00:00:00", etc.

Is there an easy way of making the "SeminarDate" item only diplay the
date and leave out the time which is set to 00:00:00 in the database Im
getting the information from anyway?

Thanks in advance,

--
_______________________________________________

DC

"You can not reason a man out of a position he did not reach through reason"

"Don't use a big word where a diminutive one will suffice."

"A man with a watch knows what time it is. A man with two watches is
never sure." Segal's Law
 
D

DC

Thanks that worked like a dream.

Luck,

Scott said:
Yes, there is an version of Eval that accepts a third parameter - a
format parameter. i.e:

<%# DataBinder.Eval(Container.DataItem, "SeminarDate", "{0:d}")%>

--
_______________________________________________

DC

"You can not reason a man out of a position he did not reach through reason"

"Don't use a big word where a diminutive one will suffice."

"A man with a watch knows what time it is. A man with two watches is
never sure." Segal's Law
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top