Solved

c# timespan

Posted on 2014-02-17
3
212 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

777 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