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;| 1 | 2026-02-02 |
| 0 | 2026-01-33 |
| 0 | 2026-02-05 |
| 0 | 2026-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.