Vb.net two Times togeather HH:MM from to text boxes

Dmcovey1993

So I have 2 labels that the times change I need to add them together they do not stay the same but I cant find a ways to get them to add right. Here is what I have.

    Dim Time1, Time2 As String
    Dim TotalTime As Integer

    'The Time that is in Lable is in Hours and Mins.
    'Example 0:13 is 13 Mins
    'Example 1:45 is 1 Hour and 45 mins 
    Time1 = Convert.ToInt32(lblTime1)
    Time2 = Convert.ToInt32(lblTime2)

    TotalTime = Time1 + Time2
End Sub
Ry-

Parse TimeSpans out of your labels’ Texts:

Dim time1 = TimeSpan.ParseExact(lblTime1.Text, "h\:mm", CultureInfo.CurrentCulture)
Dim time2 = TimeSpan.ParseExact(lblTime2.Text, "h\:mm", CultureInfo.CurrentCulture)

Dim totalTime = time1 + time2

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to subtract two HH:MM:SS times from each other in Perl?

From Dev

Generic function for all text boxes in VB .NET

From Dev

Hour difference between two times(HH:MM:SS a)in momentjs

From Dev

Nothing displayed on TextView after subtracting two times (hh:mm:ss)

From Dev

Difference between two times in format (hh: mm: ss)

From Dev

compare two times format HH:MM java-android

From Dev

Nothing displayed on TextView after subtracting two times (hh:mm:ss)

From Dev

Compare two times in HH:MM:SS format - ksh

From Dev

compare two times format HH:MM java-android

From Dev

get the time difference between two times in format hh:mm:ss

From Dev

vb.net - Formatting a datetime column of a datatable to a yyyy/MM/dd HH:mm string

From Dev

updating a sql 2005 database using text boxes in vb.net

From Dev

How do I calculate the difference of times from three text boxes?

From Dev

How to take value from dynamically created text boxes to excel sheet in VB.net this is the code I am using

From Dev

Adding two times one is string and another one is date of HH:mm in java

From Dev

Get difference between two times that are in hh:mm format and greater than 24 hours

From Dev

Calculating the sub total from a list of check boxes in vb.net

From Dev

Adding multiple times in (HH.mm)

From Dev

How to plot chron times in hh:mm?

From Dev

output time format as "hh:mm:ss" in vb

From Dev

output time format as "hh:mm:ss" in vb

From Dev

vb.net subtract two excel cell date and times

From Dev

why does the conversion of two elements from a string, from char to int, not add togeather?

From Dev

Divide times in two boxes and find the minimum difference

From Dev

Type in two text boxes simulatenously

From Dev

Type in two text boxes simulatenously

From Dev

Sides of text boxes being cut off in VB.net WPF controls

From Dev

Skip/Ignore/Bypass empty Text boxes while calculating in vb.net

From Dev

Better option to get time in hh:mm format from two given time

Related Related

  1. 1

    How to subtract two HH:MM:SS times from each other in Perl?

  2. 2

    Generic function for all text boxes in VB .NET

  3. 3

    Hour difference between two times(HH:MM:SS a)in momentjs

  4. 4

    Nothing displayed on TextView after subtracting two times (hh:mm:ss)

  5. 5

    Difference between two times in format (hh: mm: ss)

  6. 6

    compare two times format HH:MM java-android

  7. 7

    Nothing displayed on TextView after subtracting two times (hh:mm:ss)

  8. 8

    Compare two times in HH:MM:SS format - ksh

  9. 9

    compare two times format HH:MM java-android

  10. 10

    get the time difference between two times in format hh:mm:ss

  11. 11

    vb.net - Formatting a datetime column of a datatable to a yyyy/MM/dd HH:mm string

  12. 12

    updating a sql 2005 database using text boxes in vb.net

  13. 13

    How do I calculate the difference of times from three text boxes?

  14. 14

    How to take value from dynamically created text boxes to excel sheet in VB.net this is the code I am using

  15. 15

    Adding two times one is string and another one is date of HH:mm in java

  16. 16

    Get difference between two times that are in hh:mm format and greater than 24 hours

  17. 17

    Calculating the sub total from a list of check boxes in vb.net

  18. 18

    Adding multiple times in (HH.mm)

  19. 19

    How to plot chron times in hh:mm?

  20. 20

    output time format as "hh:mm:ss" in vb

  21. 21

    output time format as "hh:mm:ss" in vb

  22. 22

    vb.net subtract two excel cell date and times

  23. 23

    why does the conversion of two elements from a string, from char to int, not add togeather?

  24. 24

    Divide times in two boxes and find the minimum difference

  25. 25

    Type in two text boxes simulatenously

  26. 26

    Type in two text boxes simulatenously

  27. 27

    Sides of text boxes being cut off in VB.net WPF controls

  28. 28

    Skip/Ignore/Bypass empty Text boxes while calculating in vb.net

  29. 29

    Better option to get time in hh:mm format from two given time

HotTag

Archive