Solved

C# todays date dd/mm/yyyy

Posted on 2008-10-07
3
1,663 Views
Last Modified: 2012-06-28
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)
0
Comment
Question by:dotnet0824
3 Comments
 
LVL 14

Accepted Solution

by:
Binuth earned 100 total points
ID: 22657355
DateTime.Now.Date.ToShortDateString()
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 50 total points
ID: 22657405
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
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 50 total points
ID: 22657600
this should do for u
String date = DateTime.Now.ToString ("dd/MM/yyyy");
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now