我有代码:
start_day: datetime.datetime = datetime.datetime.strptime(
"06.10.2023 16:10", "%d.%m.%Y %H:%M"
)
current_day: datetime.datetime = datetime.datetime.strptime(
"09.10.2023 16:10", "%d.%m.%Y %H:%M"
)
days_without_defects: datetime.timedelta = current_day - start_day
他会告诉我
3 days, 0:00:00
虽然我们计算了周五和周一的差异。我知道您可以求助于 numpy 库,特别是np.busday_count方法,但它没有考虑时间。如何在不使用任何有关假期等的 json 数据的情况下解决这个问题?