Stripping a DateTime Object of its time value

  • Thread starter Thread starter tariq
  • Start date Start date
T

tariq

Hi,

Any knows how i can strip a Date time object of the time value in it.

My current approach is
tempdate = DateTime.Parse(tempDate.ToShortDateString());

Looks quite nasty. Anyone knows of a better way?



- T
 
tariq said:
Any knows how i can strip a Date time object of the time value in it.

My current approach is
tempdate = DateTime.Parse(tempDate.ToShortDateString());

Looks quite nasty. Anyone knows of a better way?

I thikn you're after the DateTime.Date property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

International Datetime issue! 1
DateTime 2
C# SQLCommand 3
DateTime Problem 4
DateTime Just Month and Year 2
Strip out seconds from a Datetime 12
Time zones and dates 6
Check if string has valid DateTime format 1

Back
Top