I need to remove the time part of the date time ...
It's impossible. You cannot use a DateTime instance without time information. For example, you cannot have an instance of DateTime as soon as 06/26/2014 or only 00:00:00:000 .
If you want to get only the date in your instance, you can use the DateTime.Date property .
Gets the date component of this instance.
But still, this .Date property sets it to midnight.
Remember that DateTime has no implicit format. It just has a date and time value. The concept of the format applies only when you want to show it as a string .
In the view part, you should use a string view like:
yourDateTime.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
source share