HumanDateDiff is a pure Delphi library for converting date/time differences into human-readable text, inspired by Moment.js / Day.js / Humanizer, but designed specifically for native Delphi (Win32/Win64/FMX).
✔ No external dependencies
✔ Locale-aware (English, Portuguese, and 10+ Indian languages)
✔ Smart calendar rules
✔ Production-ready
- Human-readable date differences
just nowyesterday / tomorrowlast week / next weeklast month / next monthlast year / next year
- Composite output
2 days, 3 hours ago
- Smart thresholds
6 days → last week30 days → last month
- Locale-specific plural rules
- Correct Hindi & Gujarati grammar
- Fluent API
- Full DUnitX test suite
- Runtime Package (.bpl) support
Add the Source folder to your Delphi Library Path.
- Open
Packages/HumanDateDiffRT.dpk - Build (or Install)
- Add
HumanDateDiffRTto your project runtime packages
uses HumanDateDiff, HumanDateDiff.Lang.EN;
ShowMessage(
THumanDateDiff.New
.Lang(LangEN)
.Diff(Now - 2, Now)
);
// → "2 days ago"THumanDateDiff.New
.Lang(LangEN)
.MaxUnits(2)
.Diff(Now - 2 - EncodeTime(3,0,0,0), Now);
// → "2 days, 3 hours ago"THumanDateDiff.New
.Lang(LangHI)
.Diff(Now - 3, Now);
// → "3 दिन पहले"THumanDateDiff.New
.Lang(LangGU)
.Diff(Now - 5, Now);
// → "5 દિવસ પહેલા"1 day ago → yesterday
6 days ago → 6 days ago
7 days ago → last week
30 days ago → last month
400 days ago → last year
This project includes a full DUnitX test suite.
To run tests:
Open Tests/HumanDateDiff.Tests.dproj
Build & Run
docs/DESIGN.md – Architecture & design decisions
docs/LANGUAGE_GUIDE.md – Adding new languages/locales
- Additional Indian languages
- CLDR plural categories
- Time-zone aware rules
- GitHub Actions CI
- GetIt package support
MIT License – free for commercial and open-source use.
Pull requests are welcome. Please include tests for new features or language packs.