Get only in today's date, with the time component excluded.
Use DateTime.Today
using System; class Program//from w w w . j a v a2s . co m { static void Main(string[] args) { // Variable of DateTime type, at first empty DateTime today; // Storing of today's date (without time component) today = DateTime.Today; // Output Console.WriteLine("Today is " + today); } }