Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.
If you have DateTime field in the database and displays it on the page it will display something like this: 3/4/2005 12:00 AM Now if you only want to display the date part which means "3/4/2005" you can easily accomplish this:
 <%#  ((DateTime)DataBinder.Eval(Container.DataItem, "DateCreated")).ToShortDateString()%>

Here "DateCreated" is the name of the field in the database and we are simply converting the returned date into ToShortDateString format. Posted on Saturday, June 25, 2005 9:24 PM | Back to top

Comments on this post: Formatting DateTime field returned from the database

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Mohammad Azam | Powered by: