Home > database >  For an idea
For an idea

Time:12-11

A holiday table
ID Holiday AMStart AMEnd PMStart PMEnd
1 2019/1/5 2019-01-05 14:00:00 18:00:00 2019-01-05
2 2019/1/6 2019-01-06 12:30:00 08:30:00 2019-01-06 2019-01-06 14:00:00 2019-01-06 18:00:00
3 2019/1/12 2019-01-12 14:00:00 18:00:00 2019-01-12
4 2019/1/13 2019-01-13 12:30:00 08:30:00 2019-01-13 2019-01-13 14:00:00 2019-01-13 18:00:00
5 2019/1/14 2019-01-13 17:00:00 2019-01-13 18:00:00

Passing parameters: the 2020-02-29 10:30:00, 3

The first parameter is expected to start time, the second is expected to use the hours, to compute is expected to end time,

Requirements
1. Work every day time is 08:30 ~ 12:30, 14:00 ~ 18:00, expect to at this time to end time,
2. Calculated by the 8 hours a day,
3. The holiday will skip,

For instance: the 2020-02-29 10:30:00 start doing things, is expected to take four hours, the afternoon is a holiday, the second day is a holiday, so it's supposed to be the 2020-03-02 completion time at 10:30

A way of thinking, hope can point in detail, thanks a lot!

CodePudding user response:

Manually placed at the top,
  • Related