endian endian - 1 year ago 90
C# Question

Best way to create a Midnight DateTime in C#

I need to create a midnight DateTime

I've just done this:

DateTime endTime = DateTime.Now;

Haven't test it yet, I'm assuming it works but is there a better/cleaner way?

Answer Source

just use foo.Date, or DateTime.Today for today's date