C# todays date dd/mm/yyyy

DateTime dt = DateTime.Now;   returns Todays Date 07/10/2008 09:03:01
String date = dt.ToString(); // this returns weird results

I want the date as 07/10/2008 (Todays date)
dotnet0824Asked:
Who is Participating?
 
BinuthConnect With a Mentor Commented:
DateTime.Now.Date.ToShortDateString()
0
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
what about this:
DateTime dt = DateTime.Now;   returns Todays Date 07/10/2008 09:03:01
String date = dt.ToString("dd/MM/yyyy");

Open in new window

0
 
Anurag ThakurConnect With a Mentor Technical ManagerCommented:
this should do for u
String date = DateTime.Now.ToString ("dd/MM/yyyy");
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.