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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Jan 19, 2012, 8:56 AM EST
If you only need date
<%# Eval("DateOfJoining", "{0:dd/MM/yyyy}")%>
Thanks
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 19, 2012, 6:15 PM EST
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
Mukesh KumarRank #615 · 3.9K reputationPosted Jan 19, 2012, 7:14 PM EST
Check this http://www.sql-server-helper.com/tips/date-formats.aspx