Solved

c# timespan

Posted on 2014-02-17
3
208 Views
Last Modified: 2014-02-17
returnDate = "03/04/2014";
departureDate = "03/01/2014";

 TimeSpan rentalDays = (Convert.ToDateTime(returnDate) -

Convert.ToDateTime(departureDate));


Response.Write(rentalDays.ToString())

it shows 3.00:00:00 from the response.write. How can I make it shown 3 only
0
Comment
Question by:CoolDev2014
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 39865631
Is this what you wanted
Response.Write(rentalDays.Days.ToString())
0
 

Author Comment

by:CoolDev2014
ID: 39865653
great. Andy. U are the best.
0
 

Author Comment

by:CoolDev2014
ID: 39865655
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now