•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 363,385 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,825 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 413 | Replies: 1
![]() |
Do you have this data in date variables or as strings ?
ill presume its a string if it isnt skip the first part.
ill presume its a string if it isnt skip the first part.
VBNET Syntax (Toggle Plain Text)
Dim totalTime As New TimeSpan(0, 0, 0) ' Declare a timespan outside the loop to hold the count For Each Record ' Create your loop to iteratively work through the returned results Dim arrStr As String() = yourVariable.split(cchar(":")) ' Break apart your string if you already have it in DateTime object then simply change the method below to use the "Hours", "Minutes" and "Seconds" property of the object Dim timTmp As TimeSpan = new TimeSpan(cint(arrStr(0)), _ cint(arrStr(1)), cint(arrStr(2))) totalTime = totalTime.Add(timTmp) Next MsgBox(totalTime.Days & " days, " & totalTime.Hours & " hours, " & _ totalTime.Minutes & " minutes and " & totalTime.Seconds & " seconds")
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
- problem with adding duration to time (Visual Basic 4 / 5 / 6)
- Exploding Niche + Residual Income + 1yr Old Domain Name (Websites for Sale)
- Adding minutes to a timestamp (PHP)
- Still working on apptlist program using queue (C++)
Other Threads in the VB.NET Forum
- Previous Thread: vb.net
- Next Thread: new datagridview column


Linear Mode