WLJS LogoWLJS Notebook

DayRound

DayRound[date, daytype] rounds date to the nearest day of daytype, using the next-day rounding convention.

DayRound[date, daytype, rounding] rounds date to the nearest day of daytype, using rounding.

Examples

Round to the next business day:

DayRound[{2024, 1, 6}, "BusinessDay"]
(* Next Monday since Saturday is not a business day *)

Round to the previous weekday:

DayRound[{2024, 1, 7}, "Weekday", "Previous"]

Please visit the official Wolfram Language Reference for more details.

On this page