Range of input time: 1900-01-01 00:00:00, 2050-01-01 00:00:00
Work time: Monday to Friday, 8 am to 12:00, 2 o 'clock in the afternoon, until 18:00
Such as: input the 2020-03-20 14:23:31, back to the 2020-03-20 17:23:31
Such as: input the 2020-03-20 05:23:31, back to the 2020-03-20 11:00:00
CodePudding user response:
Input time plus three hours to determine whether directly in the three rest time (time over the weekend, the evening after work time, lunch break) is the current time, on the basis of previous, combined with the three specific timeCodePudding user response:
My idea is that you can judge a few first, and then to judge the time, only can judge hours, if hours add 5 at 9 to 12 hours, if hours needs when 15 to 18 plus 17 hours, if is the 18-9 11, 12-14 hours directly output, is output plus 3 hours for 17 14 to 15