We run a service that's based on a 2 business day SLA, so if the request is submitted at 1pm on Monday it should be completed by 1pm of Wednesday.
So in the database I have two MySQL timestamps YYYY/MM/DD HH:MM:SS, and need some way of working out the time between the two dates in working time, based on office hours of 9am till 5pm.
Can anyone give me any ideas?
The simplest way would be to store a table into your database with one line for each day, containing the working time available on that day. This lets you handle holidays and week-ends with high granularity, and you can get the amount of time available by running a sum over the days between the two dates specified by the user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With