date time heutiges datum

C#
DateTime a = ;//some datetime
DateTime now = DateTime.Now;
TimeSpan ts = now-a;var date= DateTime.Now.Date;string x = DateTime.Now.ToShortDateString()
Source

Also in C#: