0

name first column : dateReceiving name second column : dateSending

data :

dateReceiving -------- dateSending

 2001/01/01 -------- 2001/01/03 2001/03/08 -------- 2001/03/12 2001/11/19 -------- 2001/11/24 2001/11/11 -------- 2001/12/18 

I want to display the time difference between sending and receiving in list box.

How do?

2 Answers 2

0

If you are using DateTime in your cells you can do something like that:

DateTime time1: your first column

DateTime time2 : your third column

TimeSpan diff = time2.Substract(time1);

Datetime: http://msdn.microsoft.com/en-us/library/system.datetime.aspx

TimeSpan: http://msdn.microsoft.com/en-US/library/vstudio/system.timespan.aspx

Edit: If your question was about multi binding => Bind an element to two sources

Sign up to request clarification or add additional context in comments.

Comments

0

Convert each date value to DateTime object and then subtract them , this will create a timespan obejct which is suitable to your situation

DateTime receivedDate = new DateTime(year, month, day); DateTime sendDate = new DateTime(year, month, day); TimeSpan ts = receivedDate - sendDate; 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.