how to solve this logic

Posted by Jayakumars under ASP.NET on 2/20/2012 | Points: 10 | Views : 705 | Status : [Member] [MVP] | Replies : 2
hi

How to Calculated this timeing
I put 2 time input textbox like this

1.From Time TextBox '9.30 am' To Time textBox '12.00 pm'
Total time i need populated this value -> 2.30
How will do this

Mark as Answer if its helpful to you


Responses

Posted by: Hmanjarawala on: 2/20/2012 [Member] Bronze | Points: 25

Up
0
Down
Use TimeSpan classes...
it works fine with DateTime Types of variable...

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 2/21/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Try this.
TimeSpan span1 = new TimeSpan(05, 30,00);

TimeSpan span2 = new TimeSpan(12,00, 00);
TimeSpan span3 = span1.Subtract(span2);
string result = Convert.ToString(span3);
string[] splitvalue = result.Split('-');
MessageBox.Show(splitvalue[1]);



Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response