Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to count an Overtime

How to count an Overtime

Scheduled Pinned Locked Moved Visual Basic
tutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Swiss Mantoro
    wrote on last edited by
    #1

    Hi.... guys I need a favor from you who have an experience in Overtime calculation, I want to build a program which could counting overtime for each employee in my company, I need to know how to count the overtime which is over than two days as well , I mean if the overtime is start from 17:00 until 04:00 following days. Thank you fro your attetnion and your support in advance. Best regards :-D ICE

    G 1 Reply Last reply
    0
    • S Swiss Mantoro

      Hi.... guys I need a favor from you who have an experience in Overtime calculation, I want to build a program which could counting overtime for each employee in my company, I need to know how to count the overtime which is over than two days as well , I mean if the overtime is start from 17:00 until 04:00 following days. Thank you fro your attetnion and your support in advance. Best regards :-D ICE

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Include the date in the data, then you can calculate the time difference without problem. The difference between 2006-06-01 17:00 and 2006-06-02 04:00 is 11 hours or 660 minutes: Dim start As DateTime = New DateTime(2006,6,1,17,0) Dim finish As DateTime = New DateTime(2006,6,2,4,0) Dim minutes As Integer = finish.Subtract(start).TotalMinutes --- b { font-weight: normal; }

      S 1 Reply Last reply
      0
      • G Guffa

        Include the date in the data, then you can calculate the time difference without problem. The difference between 2006-06-01 17:00 and 2006-06-02 04:00 is 11 hours or 660 minutes: Dim start As DateTime = New DateTime(2006,6,1,17,0) Dim finish As DateTime = New DateTime(2006,6,2,4,0) Dim minutes As Integer = finish.Subtract(start).TotalMinutes --- b { font-weight: normal; }

        S Offline
        S Offline
        Swiss Mantoro
        wrote on last edited by
        #3

        Hi Guffa Thank a lot for your advise and I have tried to write and run those command into a small program but it doesn't working well. I made Three Text box ( textbox1,textbox2 and textbox3), and here is the structure of my program dim start as datetime dim finish as datetime dim minutes as integer start=textbox1.text finish =textbox2.text minutes=finish.subtract(start).totalminutes textbox3.text=minutes I tried to run this program but it wont be runing propherly it just has 0 as the result came up on the textbox3 I am affraid that I have made a mistake, but I have no idea how to write the right logic program for this case. If you don't mind please let me get your next advise Thank you Best regards :) ICE

        G 1 Reply Last reply
        0
        • S Swiss Mantoro

          Hi Guffa Thank a lot for your advise and I have tried to write and run those command into a small program but it doesn't working well. I made Three Text box ( textbox1,textbox2 and textbox3), and here is the structure of my program dim start as datetime dim finish as datetime dim minutes as integer start=textbox1.text finish =textbox2.text minutes=finish.subtract(start).totalminutes textbox3.text=minutes I tried to run this program but it wont be runing propherly it just has 0 as the result came up on the textbox3 I am affraid that I have made a mistake, but I have no idea how to write the right logic program for this case. If you don't mind please let me get your next advise Thank you Best regards :) ICE

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Despite the total disregard for data types, it looks like the code should work. What did you enter in the textboxes? --- b { font-weight: normal; }

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups