I need to remove time portion of date time or probably have the date in following format in object form not in the form of string.
object
string
Use the Date property:
var dateAndTime = DateTime.Now; var date = dateAndTime.Date;
The date variable will contain the date, the time part will be 00:00:00.
date
00:00:00