how to print datetime in c# code example
Example 1: csharp datetime string format
DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")
Example 2: c# get date without time
var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;
DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")
var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;