Skip to main content

WORKDAY

Calculates a future or past date by adding or subtracting a specified number of workdays (Monday–Friday), optionally excluding holidays.

Syntax

WORKDAY(start_date, days, [holidays])

Arguments

  • start_date: The starting date. Can be a Unix timestamp (in seconds) or an ISO date string (e.g., "2025-07-14").
  • days: The number of workdays to add or subtract. Can be positive (future) or negative (past).
  • holidays (optional): A list of dates (as Unix timestamps or ISO strings) to exclude from counting as workdays.

Behavior

  • Skips Saturdays and Sundays automatically.
  • Skips any dates listed in the holidays array.
  • Returns a AnyDB time representing the resulting date.

Example

WORKDAY("2025-07-15", 3) → Returns timestamp for "2025-07-18"
WORKDAY("2025-07-12", 1) → Returns timestamp for "2025-07-15" (skips weekend)
WORKDAY("2025-12-22", 3, ["2025-12-25"]) → Returns timestamp for "2025-12-26"