Course of Raku / Advanced / More about built-in types / Date and time / Date arithmetic

Quiz — Date arithmetic

What does the following program print?

say Date.new(2026, 1, 28) + 5;
12026-02-02
02026-01-33
02026-02-05
02026-02-03

Adding an integer moves the date forward by that many days, rolling into the next month automatically. Five days after 28 January 2026 lands on 2 February — January’s remaining three days (29, 30, 31) plus two more.

Course navigation

Date arithmetic   |   Quiz — Adding months