Eval format date time

Larry Brister
Larry Brister used Ask the Experts™
on
I have a <%#Eval("createdDate")%> tag in my page and the datetime is showing up as
8/31/2010 3:38:44 PM

How do I keep the minutes and get rid of the seconds?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014

Commented:
Try

<%#Eval("createdDate").ToString("MM/dd/yyyy HH:mm")%>
Commented:
<%# Eval("createdDate", "{0:M/dd/yyyy h:mm tt}") %>

Should do the trick
Larry Bristersr. Developer

Author

Commented:
codecruiser
I tried that before and got a Input string was not in a correct format.

All the data id defiinately datetime
Larry Bristersr. Developer

Author

Commented:
Perfect.  Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial