CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Dec 2010

    Calculate a timespan of work of an employee in an HR system

    There are 2 pay rates - normal rates and overtime rates.
    An employee can work in many different hour combination say
    * 2012-10-30 08:00 to 2012-10-30 18:30
    * 2012-10-30 10:30 to 2012-10-30 15:00
    * 2012-10-30 07:00 to 2012-11-02 23:00

    Despite of leaves and other allowances, how do you calculate their time spans of work
    Say in the first day, he works from 7:00 - 23:59 and 2 full days and the last day 0:00 to 23:00 etc
    My first thought was to convert this to a Calendar and compare the dates first and work out the full days worked.
    if there is at least one full day, I subtract 23:59 from his on-duty time
    and subtract his off-duty time from 0:00.
    And then, I compare the range of time with the normal working-hours and OT hours
    The problem is how do you convert a timestamp data type to calendar?
    Am I on the right track?
    Last edited by lucky6969b; October 10th, 2012 at 01:18 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.