c# remove time in datetime

C#
var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;
Source

Also in C#: