Nov 29, 2005 #1 darkdido Programmer Nov 23, 2005 8 SD how can calculate time in vb 6 like..(30:30+20:15)=50:45
Nov 29, 2005 #2 gmmastros Programmer Feb 15, 2005 14,901 US VB does not have a time data type. There is a date data type that has a time component. I assume this to mean 30 minutes 30 seconds PLUS 20 minutes 15 seconds. If so, then.... Dim dte1 As Date Dim dte2 As Date dte1 = CDate("0:30:30") dte2 = CDate("0:20:15") Debug.Print dte1 + dte2 You'll notice that the resutl is... 12:50:45 AM You'll need to format the final result to suit your style. -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom Upvote 0 Downvote
VB does not have a time data type. There is a date data type that has a time component. I assume this to mean 30 minutes 30 seconds PLUS 20 minutes 15 seconds. If so, then.... Dim dte1 As Date Dim dte2 As Date dte1 = CDate("0:30:30") dte2 = CDate("0:20:15") Debug.Print dte1 + dte2 You'll notice that the resutl is... 12:50:45 AM You'll need to format the final result to suit your style. -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
Nov 29, 2005 #3 S SkipVought Programmer Dec 4, 2001 47,487 US Hi, Code: MsgBox Format(TimeValue("00:30:30") + TimeValue("00:20:15"), "[h]:nn:ss") Skip, [sub] [red]Be Advised![/red] The band of elderly oriental musicians, known as Ground Cover, is, in reality... Asian Jasmine![/sub] Upvote 0 Downvote
Hi, Code: MsgBox Format(TimeValue("00:30:30") + TimeValue("00:20:15"), "[h]:nn:ss") Skip, [sub] [red]Be Advised![/red] The band of elderly oriental musicians, known as Ground Cover, is, in reality... Asian Jasmine![/sub]