Solved

c# timespan

Posted on 2014-02-17
3
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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