C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Tip: This program was run on a specific date. When you run it on your computer, the time will differ.
C# program that uses DateTime.Today
using System;
class Program
{
static void Main()
{
DateTime today = DateTime.Today;
DateTime now = DateTime.Now;
Console.WriteLine(today);
Console.WriteLine(now);
}
}
Output
2/25/2011 12:00:00 AM
2/25/2011 1:29:21 PM
Note: You can get DateTime.Today from DateTime.Now on your own as well. Simply remove the hours, minutes and seconds.