Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to retreive ' System.DateTime.Now.Date.ToShortDateString()' in required date format (dd/MM/yyyy)? please help
Posted
Updated 15-Apr-14 1:33am
v3

Check the documentation:

http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx[^]

System.DateTime.Now.Date.ToString("dd/MM/yyyy");
 
Share this answer
 
DateTime.Now.ToString("dd/MM/yyyy");
 
Share this answer
 
DateTime
C#
dt = DateTime.ParseExact(System.DateTime.Now.Date.ToShortDateString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);

string s = dt.ToString("dd/MM/yyyy");
 
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