The
DateTime
object in .Net has a
ToString
method with a large number of overrides.
You can use this to get just the date part but there are many ways using locales and globalization.
But in the simplest term, if you're not worry about multi national programming you could do this:
DateTime.Now.ToString("dd/MM/yyyy")
or
DateTime.Now.ToString("MM-dd-yyyy")
If you want to use the locale settings you could try:
DateTime.Now.ToShortDateString()
or
DateTime.Now.ToLongDateString()