Day.js

Fast 2KB Moment.js-compatible date library. Immutable date objects with the same Moment.js API — parse, validate, manipulate, and display dates and times. Supports timezones (via plugin), localization (140+ locales), relative time, duration, and date arithmetic. The go-to Moment.js replacement offering identical API at 1/10th the size. Used everywhere Moment.js was used but with better performance and tree-shaking.

Evaluated Mar 07, 2026 (0d ago) v1.11+
Homepage ↗ Repo ↗ Developer Tools date time javascript moment-alternative 2kb immutable timezone i18n
⚙ Agent Friendliness
68
/ 100
Can an agent use this?
🔒 Security
95
/ 100
Is it safe for agents?
⚡ Reliability
90
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
88
Error Messages
80
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
98
Auth Strength
95
Scope Granularity
92
Dep. Hygiene
92
Secret Handling
98

Pure computation library — no network calls, no data storage. No security concerns. MIT licensed. Zero dependencies.

⚡ Reliability

Uptime/SLA
90
Version Stability
90
Breaking Changes
92
Error Recovery
88
AF Security Reliability

Best When

You need Moment.js's API for date manipulation with a dramatically smaller bundle size and immutable objects.

Avoid When

You need functional programming patterns with date-fns, or want the most comprehensive timezone handling (use Luxon or Temporal).

Use Cases

  • Parse, format, and display dates using Moment.js-compatible API without Moment.js's 300KB bundle size
  • Handle timezone-aware date operations using dayjs-plugin-timezone for applications with global users
  • Display relative times ('2 hours ago', '3 days left') using dayjs's relativeTime plugin
  • Perform date arithmetic (add/subtract days, months, years) with chainable, immutable Day.js objects
  • Support 140+ locales for internationalized date formatting using Day.js's locale system

Not For

  • Complex timezone edge cases requiring IANA database precision — date-fns-tz or Luxon may handle edge cases better
  • Temporal API adoption — browser's native Temporal will eventually replace all date libraries; Day.js is a bridge
  • Server-side date manipulation in Rust/Go/Python — Day.js is JavaScript-only

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

No authentication — utility library.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT licensed. Completely free. Widely adopted as the Moment.js replacement.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Plugins must be explicitly loaded — dayjs.extend(relativeTime), dayjs.extend(timezone) etc.; missing extends causes method-not-found errors
  • Invalid dates silently produce NaN objects instead of throwing — always call .isValid() before using parsed dates
  • Timezone support requires both utc and timezone plugins together — utc alone doesn't enable tz() method
  • Locale files must be imported for non-English locales — dayjs.locale() with just a string doesn't work without importing the locale module
  • Day.js is not compatible with the new TC39 Temporal proposal — don't use Day.js as an abstraction expecting future Temporal compatibility
  • Mutability: Day.js is immutable but plugins like duration can have mutable behavior — verify plugin documentation

Alternatives

Full Evaluation Report

Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for Day.js.

AI-powered analysis · PDF + markdown · Delivered within 30 minutes

$99

Package Brief

Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.

Delivered within 10 minutes

$3

Score Monitoring

Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.

Continuous monitoring

$3/mo

Scores are editorial opinions as of 2026-03-07.

6451
Packages Evaluated
26150
Need Evaluation
173
Need Re-evaluation
Community Powered