I have sample data in database.
When i retrieve date from database its retrieving with time also as follows
I need to bind only time while binding data using above statement..
12-3-2011 12:00 AM
I need to bind only time while binding data using above statement..
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Jan 19, 2012, 1:56 PM
If you only need date
<%# Eval("DateOfJoining", "{0:dd/MM/yyyy}")%>
Thanks
Mukesh KumarPosted Jan 20, 2012, 12:14 AM
Check this http://www.sql-server-helper.com/tips/date-formats.aspx
Jignesh TrivediPosted Jan 19, 2012, 11:15 PM
you can also convert date time specific format at time of quering database.
select convert(varchar,GETDATE(),110)
out put is : 01-20-2012
select convert(varchar,GETDATE(),111)
out put is : 2012/01/20
hope this help.
http://msdn.microsoft.com/en-us/library/ms187928.aspx