TExcelTAD
Home › Release Engineering & CI/CD › Calendar Versioning

Calendar Versioning

SemVer answers "is this compatible?". For many products nobody asks that question: an operating system, a game, a desktop app, a data bundle, a service that only you deploy. For them the useful question is "how old is this?", and calendar versioning (CalVer) answers it by putting the release date into the version.

The building blocks

CalVer is a family of schemes built from these tokens:

Token Meaning Example (2026-01-15)
YYYY full year 2026
YY short year, no padding 26
0Y short year, zero-padded 26
MM / 0M month / zero-padded month 1 / 01
WW / 0W week of the year 2 / 02
DD / 0D day of the month 15 / 15
MICRO a counter for releases within the period 0, 1, 2…
MINOR a counter that increases per release, reset each year 1, 2…

Who uses what

Project Scheme Example
Ubuntu YY.0M (release month) 24.04, 26.10
pip YY.MINOR[.MICRO] 26.2, 26.2.2
Black (Python formatter) YY.MM.MICRO 26.1.0
certifi (CA bundle) YYYY.MM.DD 2026.10.23
JetBrains IDEs YYYY.MINOR[.MICRO] 2026.2.1
Unity YYYY.MINOR for older releases, now Unity 6.x 2022.3 LTS
vcpkg a dated tag YYYY.MM.DD 2026.10.16

Notice two things. First, almost every CalVer scheme still produces three dot-separated numbers or fewer, so it parses as a version in package managers and sorts correctly with plain numeric comparison. Second, many projects mix CalVer with a compatibility promise: pip announces deprecations a few releases ahead, Ubuntu's .04 releases in even years are LTS. The date doesn't replace a policy; it replaces the guessing about what number comes next.

Pitfalls

  • Leading zeros. 2026.01.15 is not a valid SemVer version (no leading zeros), and npm, Cargo and Go would reject it; PEP 440 normalises it to 2026.1.15. Use 0M only where the ecosystem allows it (Ubuntu does; package registries mostly don't).
  • Two releases on the same day. YYYY.MM.DD can't express the second hotfix of the day; add a MICRO (2026.1.15.1, or 2026.1.15-1 for a Debian-style revision).
  • Time zones. "Today" depends on where the build machine is. Compute the date in UTC, from the commit time or SOURCE_DATE_EPOCH, never from the build machine's wall clock, otherwise a rebuild of the same commit gets a different version.
  • Compatibility is invisible. 2026.3.0 → 2026.4.0 might break everything. If people depend on your API, state the policy ("we remove deprecated APIs only in the first release of a year") or use SemVer.

A runnable model: the next CalVer version

A release script needs a function "given the release date and the last version, what's next?". This one supports three schemes and handles several releases in one period:

python · try it yourself
from datetime import date

def calver(scheme, day, last=None):
    if scheme == "YY.0M":
        base = f"{day.year % 100}.{day.month:02d}"
    elif scheme == "YYYY.MM.MICRO":
        base = f"{day.year}.{day.month}"
    elif scheme == "YY.MINOR":
        # MINOR counts releases within the year, starting at 0
        prefix = f"{day.year % 100}"
        if last and last.split(".")[0] == prefix:
            return f"{prefix}.{int(last.split('.')[1]) + 1}"
        return f"{prefix}.0"
    else:
        raise ValueError(scheme)
    if scheme == "YYYY.MM.MICRO":
        if last and last.rsplit(".", 1)[0] == base:
            return f"{base}.{int(last.rsplit('.', 1)[1]) + 1}"
        return f"{base}.0"
    return base

releases = [date(2026, 1, 15), date(2026, 1, 29), date(2026, 3, 2), date(2026, 12, 30), date(2027, 1, 4)]
for scheme in ["YYYY.MM.MICRO", "YY.MINOR", "YY.0M"]:
    last, out = None, []
    for d in releases:
        last = calver(scheme, d, last)
        out.append(last)
    print(f"{scheme:<14} " + "  ".join(out))

# CalVer versions still sort as numbers, as long as each part is numeric.
mixed = ["2026.1.1", "2025.12.3", "2026.1.0", "2026.10.0", "2026.2.0"]
print(sorted(mixed, key=lambda v: tuple(int(p) for p in v.split("."))))
print(sorted(mixed))   # string sorting is wrong: 2026.10.0 before 2026.2.0
YYYY.MM.MICRO  2026.1.0  2026.1.1  2026.3.0  2026.12.0  2027.1.0
YY.MINOR       26.0  26.1  26.2  26.3  27.0
YY.0M          26.01  26.01  26.03  26.12  27.01
['2025.12.3', '2026.1.0', '2026.1.1', '2026.2.0', '2026.10.0']
['2025.12.3', '2026.1.0', '2026.1.1', '2026.10.0', '2026.2.0']

YY.0M gives the same version for two releases in January; that scheme only works when there is at most one release per month (Ubuntu's case). The last two lines are the reason to always compare versions as tuples of integers, whichever scheme you use.

Choosing between SemVer and CalVer

Choose SemVer when… Choose CalVer when…
other code depends on you through an API (libraries, SDKs, CLIs used in scripts) people run you rather than build on you (apps, games, OS images, services)
consumers use version ranges to accept safe updates automatically releases are time-boxed (release trains, see Release Trains & Checklists)
breaking changes are rare and should be loud support windows are time-based ("we support the last 12 months")
the tools in this course (semantic-release, changesets, git-cliff --bump) should compute the number the date is what users and support staff ask about

You can also combine them: a game might ship 2026.3 to players while its modding SDK uses SemVer, and a library might publish SemVer versions on a monthly train. Field Notes has more on versioning libraries vs applications.

Test yourself

Why should a CalVer date come from the commit time (or SOURCE_DATE_EPOCH) and not the build machine's clock?

  1. Clocks on CI machines are always wrong
  2. So rebuilding the same commit yields the same version, in any time zone
  3. Git requires it
  4. It makes the version shorter

Which CalVer version is acceptable to npm, Cargo and Go as a SemVer version?

  1. 2026.01.15
  2. 2026.1.15
  3. 26.01
  4. 2026-01-15

Which product is the best fit for CalVer?

  1. A JSON parsing library used by thousands of packages
  2. A desktop game updated monthly
  3. A gRPC client SDK
  4. A compiler plugin API