0

in my work i get 03:00:00 as the total hours work..how can i make it in just 3?

Dim TimeOutHours = TimeSpan.FromHours(Val(DateTime.Parse(TimeOfDay.ToString(Me.TimeOutTextBox.Text.Trim)).Hour))
    Dim TimeInHours = TimeSpan.FromHours(Val(DateTime.Parse(TimeOfDay.ToString(Me.TimeInTextBox.Text.Trim)).Hour))

    Dim TimeOutMins As Integer = (Val(DateTime.Parse(TimeOfDay.ToString(TimeOutTextBox.Text)).Minute))
    Dim TimeInMins As Integer = (Val(DateTime.Parse(TimeOfDay.ToString(TimeInTextBox.Text)).Minute))

    Dim mingreat As TimeSpan = TimeOutHours.Subtract(TimeInHours).Subtract(TimeSpan.FromHours(1))
    Dim minless As TimeSpan = TimeOutHours.Subtract(TimeInHours)
    TotalHWTextBox.Text = minless.ToString
Attachments Untitled.png 96.84 KB
3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by xerohomicide
0

Change
Dim minless As TimeSpan = TimeOutHours.Subtract(TimeInHours)
to
Dim minless As Integer = CINT(TimeOutHours.Subtract(TimeInHours))

Edited by G_Waddell

1

Dim minless As TimeSpan = TimeOutHours.Subtract(TimeInHours)
TotalHWTextBox.Text = minless.Hours.ToString()

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.