Learn to Code ยท zero-dependency ยท MIT

larzdate

Date arithmetic from first principles.

The datetime module hides the interesting bits; larzdate computes them in the open - leap years, what weekday any date falls on, days between dates, and a printable month calendar - all from plain year/month/day numbers, with no datetime dependency.

larzscript pkg install date
View on GitHub →Learn the stack

What you get

Try it

import "date" as date
print(date.is_leap_year(2024))
print(date.days_in_month(2024, 2))
print(date.day_of_week(2026, 8, 1))
print(date.days_between(2026, 1, 1, 2026, 8, 1))
print(date.add_days(2026, 1, 1, 213))
Output
true
29
6
212
{y: 2026, m: 8, d: 2}

Why it's in the Larz Stack

larzdate is a real Larzscript package (larzscript pkg install date) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.