28 Sep 2011

Removing the seconds from DateTime

 

date = date.AddSeconds( - date.Second));

Example:

DateTime date = DateTime.Now;
Console.WriteLine("Date without seconds = {0}", date.AddSeconds(- date.Second));

No comments:

Post a Comment