current date and time in c# format code example
Example 1: c# get current date
DateTime now = DateTime.Now;
Example 2: c# get date without time
var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;
DateTime now = DateTime.Now;
var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;