问题描述
我想要一个场景,我想计算排除假期的两个日期和时间之间的时差(即星期六和星期日)。同时工作时间为9小时计算(即开始时间为12:00 PM,结束时间为晚上9:00),因此在此时间之后,不应计算
非工作时间。
I want a scenario where i want to calculate time difference between two date and time that exclude holiday(i.e. Saturday and Sunday). As well working hours par day as 9 hrs calculation(i.e. Start time is 12:00PM and End time is 9:00PM) so after this hours non-working hours should not be calculated in thatcalculation.
例如假设2018年3月14日晚上8点有一个请求,并且在第二天(即2018年3月15日)下午02:00批准。所以这些时间差将是3小时。我如何使用C#实现这一目标?
e.g. Suppose there is one request on 14th March 2018 8:00PM and it's approved on next Day(i.e. 15th March 2018) on 02:00PM. so these time difference will come as 3hrs. How i can achieve this using C#?
推荐答案
这篇关于计算两个日期和时间之间的总时间差,不包括假期和非工作时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!