Example explorer
Browse the maintained Moment.js API by workflow instead of reading a flat README: parsing, strict validation, locale rendering, UTC offsets, durations, and range comparisons all stay visible in one place.
A maintained Moment.js fork for parsing, validating, manipulating, formatting, and localizing dates with the classic API teams still depend on in production.
npm install @stackline/moment
import moment from '@stackline/moment'; import '@stackline/moment/locale/fr';
moment.locale('fr');
const value = moment('2026-04-05 09:30', 'YYYY-MM-DD HH:mm', true);
value.clone().utc().format('YYYY-MM-DDTHH:mm:ss[Z]');
Browse the maintained Moment.js API by workflow instead of reading a flat README: parsing, strict validation, locale rendering, UTC offsets, durations, and range comparisons all stay visible in one place.
These are the core package entry points and helpers that show up repeatedly across the versioned docs.
| API | Description |
|---|---|
moment(input) |
Creates a local moment instance from strings, dates, arrays, objects, or timestamps. |
moment.utc(input) |
Creates a UTC-based instance without relying on local timezone output. |
moment.parseZone(input) |
Parses and preserves the original offset encoded in the input string. |
moment.duration(value, unit) |
Creates a duration object for humanize, ISO serialization, and unit math. |
| API | Description |
|---|---|
moment(value, format) |
Parses custom formatted strings with a declared token pattern. |
moment(value, format, true) |
Strict parsing rejects partial matches and malformed tokens. |
isValid() |
Checks whether the current instance resolved to a valid date. |
parsingFlags() |
Exposes unused tokens, overflow, and other parser diagnostics. |
| API | Description |
|---|---|
format(pattern) |
Formats the current instance with tokens such as YYYY, MM, and LLLL. |
calendar() |
Returns locale-aware calendar phrases such as “Today at 9:00 AM”. |
fromNow() |
Generates human relative time against the current moment. |
moment.locale(locale) |
Switches the global locale used for long formats and relative time strings. |
| File | Description |
|---|---|
moment.js |
Classic CommonJS/browser entry kept for legacy integration paths. |
dist/moment.js |
ES module-friendly build distributed with the package. |
locale/ |
Individually loadable locale bundles for targeted installs. |
min/ |
Browser-ready minified assets used by these versioned demos. |
moment.d.ts |
Bundled TypeScript declarations for classic and TS 3.1+ consumers. |