I need to remove time portion of date time...
It is impossible. You can't have a DateTime instance without time information. For example, you can't have a DateTime
instance as just 06/26/2014
or just 00:00:00:000
only.
If you wanna get only date part of your instance, you can use DateTime.Date property.
Gets the date component of this instance.
But still, this .Date
property assign it's time part to midnight.
Remember, a DateTime
doesn't have any implicit format. It just have date and time values. The concept of format only applies when you want to show it as a string
.
In a representation part, you have to use string representation as;
yourDateTime.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);