c# datetime remove time

51

c# datetime remove time -

DateTime dateAndTime = DateTime.Now;
Console.WriteLine(dateAndTime.ToString("dd/MM/yyyy")); // Will give you smth like 25/05/2011

c# remove time in datetime -

var dateAndTime = DateTime.Now;
var date = dateAndTime.Date;

Comments

Submit
0 Comments