Reputation: 59
How do you get the current date (not time) in C# ?
Example:
19/03/2011
[Edit] I got the solution. thanks for answering... :)
DateTime dt = DateTime.Now;
string sDate = dt.ToShortDateString();
Upvotes: 2
Views: 40745
Reputation: 50825
System.DateTime.Now.Date
will get the date part only. It actually gives you the date at midnight.
Upvotes: 7