Remove Time from a DateTime Object in C#

added by DotNetKicks
3/23/2022 3:58:46 PM


When we need to work with time in C# we use the DateTime type. DateTime values have two components, as easily inferred from the name - a date part and a time part. Since in some cases we might need only one part out of the two, in this article we're going to learn how to remove time from a DateTime in C#.