0

need help...

i have scenario..

note: i want a logical method to solve and get the time differential of night schedule. for attendance monitoring.

first, the night differential schedule (10:00:00PM - 06:00:00AM) second, my regular attendance shift schedule is :

[3PM - 6PM]

[break time: 6pm - 7pm]

[07PM - 11PM]

due of differential.. from 10pm-6am.. i have night shift differential of total (1 hour) from 10pm - 11pm

can someone would give me an idea on what code to use that could get the answer of 1 hour.

i use timespan and calculating time of hours.. but i don't know the logic or method.

thank you

  • The only obstacle preventing us from helping you is the language. Try letting someone else re-phrase your question. – Ahmad Feb 09 '13 at 06:53
  • Please explain if my thoughts are correct. You have a regular shift from 3PM till 11PM with a break from 6PM till 7PM, a night shift from 10PM till 6AM and you want to know the difference between the 11PM and 10PM? – Steve Feb 09 '13 at 10:16
  • yes sir.. that is correct. i need to get the time difference that the 1 hour is the night shift differential. the problem is i dont know how to get the value of 1. – Deorwin Bensurto Feb 10 '13 at 23:24
  • The answer to this question will vary wildly depending on what the shape of your input data is. Can you please post some code samples? At minimum, create an empty method with the input and output parameters specified, and we can help you fill in the implementation. – Matt Johnson-Pint Feb 15 '13 at 20:29

1 Answers1

0
Sub TimeIN_TimeOut()

    Dim timeIn(4), timeOut(4) As DateTime

    Dim days As String() = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday"}
    Dim totalHours, subTotal(4) As Double

    For x As Integer = 0 To 4
        WriteLine()

        Write("Enter Time-In for {0}:", days(x))
        timeIn(x) = ReadLine()

        Write("Enter Time-Out for {0}:", days(x))
        timeOut(x) = ReadLine()


        subTotal(x) += timeOut(x).Subtract(timeIn(x)).TotalHours

        totalHours += subTotal(x)


    Next
    WriteLine()
    WriteLine()
    WriteLine("__________________________________________________")
    WriteLine("Total work Hours from {0} to {1}:{2}", days(0), days(4), totalHours)



End Sub