Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So, i have 4 textboxes.
txt01 is date in format 21.08.2014
txt02 is date in format 24.08.2014
txt03 is time in format 12:00
txt04 is time in format 09:00

I need to get only full hours between 21.08.2014 12:00 and 24.08.2014 09:00

The question is, how to do that in vb.net?
Posted

1 solution

TotalHours is what you need

check this out http://msdn.microsoft.com/en-us/library/system.timespan.totalhours.aspx[^]

something like
C#
var hours = (datevalue1 - datevalue2).TotalHours;
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900