我需要检查是否有任何工作时间段在日期时间之间,并计算工作时间总和超过 8 小时之间的时间。
样本数据:
1. Work time: 07:00 - 17:00 and datetime for checking 06:00-22:00
Answer: 2 hour
2. Work time: 13:00 - 23:00 and datetime for checking 06:00-22:00
Answer: 1 hour (only 1 hour is grater 8 hours and between 06:00-22:00 )
3. Work time: 19:00 - 05:00 and datetime for checking 22:00-06:00
Answer: 2 hour (only 2 hour is grater 8 hours and between 22:00-06:00 )
有任何想法吗?