Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,


I am getting datacolumn datatype is like 05/14/2013 6:48:03 PM but i dont want time only I want to display date(05/14/2013) so please anybody help me out


Regards
Sangamesh Arali
9591678357
Posted
Comments
Maciej Los 15-May-13 8:03am    
What kind of database type?

You can use String.Format function.

String.Format("{0:MM/dd/yyyy}", "Your String goes here")
 
Share this answer
 
Hi,


Add below code in page load event of your page then it will work


CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
      culture.DateTimeFormat.ShortDatePattern = "MM/dd/yyyy"; 
      culture.DateTimeFormat.LongTimePattern = "";  
      Thread.CurrentThread.CurrentCulture = culture;





Regards
Sangamesh Arali
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900