Dates That Don't Break: Days, Months, and Times in Your Data
By the end, you'll convert, filter, group, and compare dates in pandas and DuckDB without a format, a time zone, or an empty month quietly changing your result.
You go at your own pace, with your Maestro beside you, 1:1, through the whole course: ask it anything, and it asks you questions too.
15 skills · 4 modules
What will you be able to do?
Each box is a skill. The base is at the bottom, recognizing and explaining, and you work your way up to building something of your own and judging what works and why. Hover over a box to see what it builds on. Click it to see where I teach it and how your Maestro checks it.
- Synthesize
- Analyze
- Apply
- Understand
Synthesize
Build a report that dates can't break
Where I teach it: Doing math with dates · Challenge: a monthly report that doesn't break
Builds on:
- Convert UTC to local time using the time zone name
- Fill in missing periods with a calendar table
- Compare against the same period last year
- Filter timestamps by whole days
Your Maestro asks you to build something of your own with it and saves it as evidence when you do.
Analyze
Compare against the same period last year
Where I teach it: Doing math with dates · How do I compare sales to the same period last year?
Builds on:
- Group dates by month, quarter, or week
- Calculate days and months between two dates
Your Maestro asks you to break a problem down with it and saves it as evidence when you do.
Apply
Convert text into dates with an explicit format
Where I teach it: A date isn't just text · How do I convert text to dates in pandas and DuckDB?
Builds on:
- Tell a date stored as text from a real date
- Explain why dd/mm and mm/dd get confused
- Explain why ISO 8601 (YYYY-MM-DD) is worth using
Your Maestro asks you to use it on a new case and saves it as evidence when you do.
Filter timestamps by whole days
Where I teach it: Times and time zones · Why does BETWEEN miss the last day? Filtering dates that have a time
Builds on:
- Convert text into dates with an explicit format
Your Maestro asks you to use it on a new case and saves it as evidence when you do.
Convert UTC to local time using the time zone name
Where I teach it: Times and time zones · How do I convert UTC to Mexico City time?
Builds on:
- Explain what a UTC timestamp is
- Convert text into dates with an explicit format
Your Maestro asks you to use it on a new case and saves it as evidence when you do.
Group dates by month, quarter, or week
Where I teach it: Grouping over time · How do I group sales by month and by quarter?
Builds on:
- Convert text into dates with an explicit format
Your Maestro asks you to use it on a new case and saves it as evidence when you do.
Calculate the ISO week and ISO year
Where I teach it: Grouping over time · Which week is January 1 in? ISO weeks in pandas and DuckDB
Builds on:
- Group dates by month, quarter, or week
Your Maestro asks you to use it on a new case and saves it as evidence when you do.
Fill in missing periods with a calendar table
Where I teach it: Grouping over time · Why doesn't a month with no sales show up when I group?
Builds on:
- Group dates by month, quarter, or week
- Explain why a period with no data doesn't show up when grouping
Your Maestro asks you to use it on a new case and saves it as evidence when you do.
Understand
Tell a date stored as text from a real date
Where I teach it: A date isn't just text · Why are my dates sorting wrong? Dates stored as text
Your Maestro asks you to explain it in your own words and saves it as evidence when you do.
Explain why dd/mm and mm/dd get confused
Where I teach it: A date isn't just text · Why does pandas mix up the day and the month? Ambiguous dates and ISO 8601
Builds on:
- Tell a date stored as text from a real date
Your Maestro asks you to explain it in your own words and saves it as evidence when you do.
Explain why ISO 8601 (YYYY-MM-DD) is worth using
Where I teach it: A date isn't just text · Why does pandas mix up the day and the month? Ambiguous dates and ISO 8601
Builds on:
- Tell a date stored as text from a real date
Your Maestro asks you to explain it in your own words and saves it as evidence when you do.
Explain what a UTC timestamp is
Where I teach it: Times and time zones · How do I convert UTC to Mexico City time?
Your Maestro asks you to explain it in your own words and saves it as evidence when you do.
Explain why a period with no data doesn't show up when grouping
Where I teach it: Grouping over time · Why doesn't a month with no sales show up when I group?
Your Maestro asks you to explain it in your own words and saves it as evidence when you do.
Who is this course for?
For anyone who works with dates in pandas or SQL and has seen a day mistaken for a month, a filter that drops the last day, or a month with no sales that never shows up. You should know how to select, filter, and group in pandas, and write SELECT, WHERE, and GROUP BY in SQL. You practice on the course page, with nothing to install.
Ask your Maestro
Your Maestro is an AI that knows this course. Ask it about the first page and it answers right here, free.
You: Where do I start?
Your Maestro: From what you already know. Tell me what you've done with data, and I'll start this page from there.
Asking about: Answers from the page "Why are my dates sorting wrong? Dates stored as text"
Only this browser keeps what you ask here. How it works
What we'll cover
A date isn't just text
Times and time zones
Grouping over time
Doing math with dates
How long does it take?
1 to 1.5 hours
A guide: you go at your own pace, and the course waits where you left off.
Common questions
- Why do my dates come out wrong in pandas or SQL?
- It is almost always one of three causes: the program read the date as text, mixed up day and month because the format was ambiguous, or ignored the time zone. The fix is to state the format explicitly and convert the time zone on purpose. The course practices this in pandas and DuckDB.
- How do I compare the same period across two years or months?
- Compare periods of the same length and align the dates before subtracting. Group by month or quarter, watch for empty months and do not mix ISO weeks with months. The last module covers date math: days between two dates, age and same period, and closes with a report challenge.
- Do I need a course, or can I learn this on my own?
- You can learn it on your own, and many people do. A course gives you the order: what to practice first, ready-to-use data, and exercises that show where you go wrong before it happens at work. This course is free, and your Maestro answers questions as you go. If you prefer going solo, the method still works.
- How much does it cost?
- Nothing. You can read every lesson without an account. To run the exercises and talk to your Maestro, sign in with your email and enroll with one tap. No card needed.
- Do I need to know SQL or pandas?
- To complete all the exercises, you need foundations in both tools: selecting, filtering and grouping in pandas, and writing SELECT, WHERE and GROUP BY in SQL. Some exercises have little starter code. The calendars module prepares WITH and LEFT JOIN with a small example; the final challenge also combines CROSS JOIN and a multi-column index. You can read with just one foundation, but prepare the other before attempting its exercises.
- Do I use pandas or DuckDB?
- Both. Explanations that depend on the tool have a pandas tab and a DuckDB tab, and the course shows you the one you picked on every page. The exercises do not change with the tab: they alternate SQL in DuckDB and Python with pandas, from your browser, with nothing to install.
- Is the data real?
- No. It's synthetic, public-domain (CC0) data for a made-up coffee shop chain, Café Altura, built with the same problems real files have.
- What should I take next?
- If you want to master WITH, joins, and GROUP BY from the ground up, take SQL for Data People: Think in Tables, Not Spreadsheets, a paid course that teaches SQL from scratch in DuckDB.
How do I check what AI does? I teach it in Your AI and Your Data: Don't Let It Make Up the Number and Check what AI gives you in three steps.
What you get
- 4 modules and 12 pages, open whenever you want them.
Open to everyone: read all of it, and your Maestro, an AI, answers your questions on every page.
With a free account: your Maestro for the whole course, always on the page you're on, and the exercises run with nothing to install.
Words you'll meet
In the lessons, tap one to see what it means, or ask your Maestro about it.
Who's teaching you
Sergio Sánchez
I'm Sergio, chekos online. I'm a data architect, and I've spent more than ten years working with data in the Bay Area, mostly at mission-driven organizations: policy research first, then education, and now early childhood services. I grew up in Tijuana. In 2018 I started tacosdedatos to share what I was learning, and since then it's been a blog, a podcast, courses, guides, and a community. These days I spend a lot of my time building with AI agents and writing about how I organize my work around them. I share what I've learned; you take what's useful and make it yours.
See you in the course
Dates That Don't Break: Days, Months, and Times in Your Data