I need to calculate the quantity of nights (stay at a hotel) from the checkin and checkout dates.
What is the best way to do it?
ie: If I have
DateTime has a property that returns the Date part which is the DateTime in midnight. You can use this part to get the nights since all parts of day will be mapped to the same time at day:
(Checkout.Date - Checkin.Date).Days