Otter Snippets Otter Upstream Otter 1.0.1 Tested

Calculate Days Between Two Dates

Compute the calendar difference in days between two date instances.

ID: snippet/date-diff-days Version: 1.0.0 License: MIT Framework: Otter 1.0.1

Architecture & Runtime Preview

Otter 1.0.1

Zero-dependency Otter 1.0.1 snippet (Dates & Times). Copy the parameterized template or run the self-contained example.

  1. 1Category: Dates & Times
  2. 2Attribution: Otter Core Language Spec (D96)
  3. 3Zero external pack dependencies — paste directly into any .ot file

Source Code (2 files)

template.ot · otter
startDay is date from "${startDate}"
endDay is date from "${endDate}"
diffDays is days between startDay and endDay

Installation & Usage

otter snippet inspect date-diff-days

Copy template.ot directly into your .ot source file, or run example.ot with 'otter run example.ot'.