Comparing
2KB immutable date time library alternative to Moment.js with the same modern API
Drop-in datetime replacement with first-class timezone support, DST awareness, and intuitive arithmetic.
| Metric | dayjs | pendulum |
|---|---|---|
| Ecosystem | npm | Python |
| Difficulty | Intermediate | Beginner ✓ |
| Weekly downloads | 43.9M↑ | 2.0M |
| Latest version | v1.11.20 | v3.0.0 |
| Recipes | 1 | 1 |
dayjs only
Shared
pendulum only
Use Day.js when you need date parsing, formatting, arithmetic (add/subtract days/months), or comparisons in browser code where bundle size matters. Its plugin system covers timezones, relative time ('3 hours ago'), duration, and ISO weeks.
Scheduling apps, calendar features, time-series data across timezones, any app where DST bugs would be costly.
For complex timezone-aware calendar applications, consider Temporal (the upcoming TC39 proposal) or date-fns with explicit timezone handling. Day.js's plugin system can grow large if you need many features.
Simple UTC-only timestamps where datetime.now(timezone.utc) is sufficient. pendulum is heavier than stdlib.
dayjs
pendulum