Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i calculate time in vb6

Status
Not open for further replies.

darkdido

Programmer
Nov 23, 2005
8
SD
vb 6
how can calculate time in vb 6
like..(10:30+20:15)
 
If the times are not stored in Date datatypes already then use CDate to convert them from strings. Use CDbl to convert DateTimes to Doubles, where the integer part represents days and the fractional part represents fractions of a day. Add the fractional parts and check for a day overflow.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
That's very confusing. Do you want to add 20 hours to 10am?
You could use the DateAdd() function to add hours, minutes, seconds, or days, but you have to convert the values first.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top