What's best practice to represent a Time object in C#?

Viewed 19502

I have a Time column in a database table. The date is not important, we just want a time in the day. What type would be best to represent it in C#? I was going to use a DateTime, but I don't like the idea of having a date.

8 Answers

Given that this question was the top result in a Google search I just did, it might be worth saying that following the imminent release of .NET 6 (currently slated for November 9th 2021) the correct answer to the question will probably be the new TimeOnly struct.

Related