This program gets the current day (with Today) and the current time (with Now). The program was executed in the early afternoon, but Today is still set to midnight.
Tip This program was run on a specific date. When you run it on your computer, the time will differ.
static void Main()
DateTime today = DateTime.Today;
DateTime now = DateTime.Now;
}6/23/2022 12:00:00 AM
6/23/2022 6:23:42 AM
Usage. Today is useful if you need to determine whether a piece of data was updated today or not. In this case, you can test the data against DateTime.Today.