跳到主要内容
uencoder

计算 business days between dates

Business day calculation excludes weekends 和 holidays. Learn 到计算工作 days, 添加/subtract business days, 和处理 holidays.

  1. 1

    Business day calculation: 数量 days 之间 two dates, excluding weekends (Saturday 和 Sunday) 和 holidays. 步骤: (1) 数量总计 days. (2) Subtract weekend days (floor(总计 / 7) * 2, plus 部分 week). (3) Subtract holidays 该 fall 开 weekdays. (4) Maintain holiday calendar (varies 通过 country/区域 — use 库 like 日期-holidays).

  2. 2
    日期计算器 →

    计算 the date difference. This gives total calendar days. To get business days, subtract weekends and holidays. The tool handles date arithmetic (add/subtract days) — use it to iterate through dates and count business days, or use the formula approach for large ranges.

  3. 3
    时间差计算器 →

    计算 the time difference between two dates. For business hours, calculate the overlap between the time range and business hours (e.g., 9 AM - 5 PM, Monday-Friday). This is more complex — handle lunch breaks, partial days, and timezone differences.

常见问题

如何 I 处理 holidays?
Maintain 列表的 holiday dates 为 relevant country/区域. Use 库 (日期-holidays, @日期/holidays-utils) 该 provides holiday 数据为 100+ countries. Holidays 变化通过 year 和区域 — Easter 是 computed (不固定), 一些 holidays 是 observed 开 nearest weekday. Update holiday 列表 annually.
什么关于 non-标准工作 weeks?
一些 regions 有 non-标准 weekends: Friday-Saturday (一些中间 Eastern countries), Sunday 仅 (一些 countries). Customize weekend days 在你的 calculation. 为 shift 工作 (24/7 操作), 每个 day 是 business day — 仅 subtract holidays. 为部分-时间 schedules, 定义工作 days per employee.

相关工具