In my office, I am creating an HR website for employees. There is a module to calculate attendance details, working hours etc.. So if an employee came to office in the morning and if he left the office at about 8PM in the night its OK. Because both In and Out and are on the same day. This is the happy path.
So then I drawing graph base on it.
But some employees are come to the office around 6pm and leaving the office on next day 2am in the morning. So their attendance is totally messed. If we check the first day they have an IN but no OUT. if we check the second day they start the day with an OUT. :D
So cant calculates time on both days.
So how to handle this problem?
** Note:** No matter what all employees will leave the office at 4am. if an employee sits after 4am it will be very rare. So if we can adjust normal day to till next day 4am that will be OK with me.
I am using MYSQL DB and ASP.net to build the site.