Aitmanga Posted March 26, 2004 Posted March 26, 2004 Hello I'm having trouble with formating a date using late binding and SqlServer. I've been using: <%# DataBinder.Eval(Container.DataItem, "registerDate","dd/MM/yyyy") %> So that it only displays the date w/o the time, but I only get this: dd/MM/yyyy instead of this: 25/03/2004 Any help is greatly appreciated Quote
georgepatotk Posted March 26, 2004 Posted March 26, 2004 For me, I would like as below: Format(theDateYouWant, "dd/MM/yyyy") Quote George C.K. Low
Aitmanga Posted March 26, 2004 Author Posted March 26, 2004 thanks, it worked: <%# Format(DataBinder.Eval(Container.DataItem, "registerDate"),"dd/MM/yyyy") %> Quote
Aitmanga Posted March 26, 2004 Author Posted March 26, 2004 Found how to do it in the dataBinder: <%# DataBinder.Eval(Container.DataItem, "registerDate","{0:d}") %> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.