>_ IzzyLab

Topic breakdown

The date utility can do more than show the current moment — it can compute properties of an arbitrary date: the -d flag tells it to take the date given as a string instead of "now." The output format is set by a string after + with percent placeholders. For the day of the week the placeholders differ in numbering: one counts per ISO (Monday = 1 … Sunday = 7), the other counts from Sunday-as-zero — and choosing the right one is the essence of the task.

What's checked

  1. day-of-week number is correct

What it looks like