c# date now code example
Example 1: c# get current date
DateTime now = DateTime.Now;
Example 2: c# datetime current
DateTime now = DateTime.Now;
string strDate = now.ToString("YYYY-MM-dd");
Example 3: date time heutiges datum
DateTime a = ;//some datetime
DateTime now = DateTime.Now;
TimeSpan ts = now-a;
Example 4: date time heutiges datum
string x = DateTime.Now.ToShortDateString()