I'm making a Time card app that keeps track of employee hours. What I would like to know, and this is an etiquette question concerning overtime hours, is:

If an employee works past midnight on the last day of the work week, and the employee has worked over 40 hours, should the extra hours worked past midnight be calculated to the completed week's overtime hours, or added to the next week's total as overtime hours?

on the first hand, working past midnight on the last day of the week is in reality working on the next week, and on second hand if you are working past midnight it is still technically the last day of the weeks shift,

What would be the proper way to go about this?
['https://workplace.stackexchange.com/questions/70045', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/52936/']
**Ask a potential customer**

We cannot safely answer this question for you for a number of reasons. As such the best place to go for this type of information is to ask multiple potential customers (preferably in different types of industries, and at least one that does government contracts) and ask them how they handle this case. Also it is safe to say since this is about labor charging that there are a whole bunch more special case rules that are likely country and state specific that can impact your app, which we cannot help with.

**Make it configurable**

The likely answer you will find from asking potential customers is all of the above and ways you did not even think of were valid. In some special circumstances it could be at the end of the week those hours count as normal hours to next week. Other cases it could be overtime for the current week, or it could be overtime hours for next week. As such make your app configurable so that the customer can choose how the heck they want to handle the case. Problem that will likely arise with this is a customer might assume that since your app allows them to do it, it must be legal (which it could easily not be).
This is a good question because it doesn't just impact software development. It means that you will have to understand the labor laws for the jurisdictions involved.

It isn't just the end of the pay period. If there are night and weekend pay differentials and an employee reports for work at 11:00 PM which pay rate are they paid? What happens if they are called in for emergency work? What happens if they end work in lower rate period? what happens if they end in a higher rate period?

Even if your options follow the law, some union agreements and contracts may specify other rules.

The best approach is to make the settings part of the business rules, and they have to be configurable, with some predefined sets of rules that will cover most cases.