Working with Dates

Truncate, diff, add, and fill missing days

40 min · interactive lesson with runnable code and 5 graded exercises.

What you'll be able to do

  • Truncate dates to month, week or year with STRFTIME
  • Compute differences in days with julianday
  • Shift dates with DATE(d, '+7 days') and filter windows safely
  • Generate a date series so zero-activity days still appear

The full lesson is free with an account.

Truncating to a period

Differences between dates

Shifting and windows

Filling missing days

Time zones