Moment.js

NPM version NPM downloads MIT License Build Status Coverage Status FOSSA Status SemVer compatibility

A JavaScript date library for parsing, validating, manipulating, and formatting dates.

Project Status

Moment.js is a legacy project, now in maintenance mode. In most cases, you should choose a different library.

For more details and recommendations, please see Project Status in the docs.

Thank you.

Resources

License

Moment.js is freely distributable under the terms of the MIT license.

FOSSA Status

moment/moment

{
"props": {
"initialPayload": {
"allShortcutsEnabled": false,
"path": "/",
"repo": {
"id": 1424470,
"defaultBranch": "develop",
"name": "moment",
"ownerLogin": "moment",
"currentUserCanPush": false,
"isFork": false,
"isEmpty": false,
"createdAt": "2011-03-01T02:46:06.000Z",
"ownerAvatar": "https://avatars.githubusercontent.com/u/4129662?v=4",
"public": true,
"private": false,
"isOrgOwned": true
},
"currentUser": null,
"refInfo": {
"name": "develop",
"listCacheKey": "v0:1708260591.0",
"canEdit": false,
"refType": "branch",
"currentOid": "18aba135ab927ffe7f868ee09276979bed6993a6"
},
"tree": {
"items": [
{
"name": ".github",
"path": ".github",
"contentType": "directory"
},
{
"name": "benchmarks",
"path": "benchmarks",
"contentType": "directory"
},
{
"name": "dist",
"path": "dist",
"contentType": "directory"
},
{
"name": "locale",
"path": "locale",
"contentType": "directory"
},
{
"name": "meteor",
"path": "meteor",
"contentType": "directory"
},
{
"name": "min",
"path": "min",
"contentType": "directory"
},
{
"name": "scripts",
"path": "scripts",
"contentType": "directory"
},
{
"name": "src",
"path": "src",
"contentType": "directory"
},
{
"name": "tasks",
"path": "tasks",
"contentType": "directory"
},
{
"name": "templates",
"path": "templates",
"contentType": "directory"
},
{
"name": "ts3.1-typing-tests",
"path": "ts3.1-typing-tests",
"contentType": "directory"
},
{
"name": "ts3.1-typings",
"path": "ts3.1-typings",
"contentType": "directory"
},
{
"name": "typing-tests",
"path": "typing-tests",
"contentType": "directory"
},
{
"name": ".editorconfig",
"path": ".editorconfig",
"contentType": "file"
},
{
"name": ".eslintrc.json",
"path": ".eslintrc.json",
"contentType": "file"
},
{
"name": ".gitattributes",
"path": ".gitattributes",
"contentType": "file"
},
{
"name": ".gitignore",
"path": ".gitignore",
"contentType": "file"
},
{
"name": ".npmignore",
"path": ".npmignore",
"contentType": "file"
},
{
"name": ".prettierrc",
"path": ".prettierrc",
"contentType": "file"
},
{
"name": ".spmignore",
"path": ".spmignore",
"contentType": "file"
},
{
"name": ".travis.yml",
"path": ".travis.yml",
"contentType": "file"
},
{
"name": "CHANGELOG.md",
"path": "CHANGELOG.md",
"contentType": "file"
},
{
"name": "CONTRIBUTING.md",
"path": "CONTRIBUTING.md",
"contentType": "file"
},
{
"name": "FAQ.md",
"path": "FAQ.md",
"contentType": "file"
},
{
"name": "Gruntfile.js",
"path": "Gruntfile.js",
"contentType": "file"
},
{
"name": "LICENSE",
"path": "LICENSE",
"contentType": "file"
},
{
"name": "Moment.js.nuspec",
"path": "Moment.js.nuspec",
"contentType": "file"
},
{
"name": "README.md",
"path": "README.md",
"contentType": "file"
},
{
"name": "bower.json",
"path": "bower.json",
"contentType": "file"
},
{
"name": "component.json",
"path": "component.json",
"contentType": "file"
},
{
"name": "composer.json",
"path": "composer.json",
"contentType": "file"
},
{
"name": "ender.js",
"path": "ender.js",
"contentType": "file"
},
{
"name": "moment.d.ts",
"path": "moment.d.ts",
"contentType": "file"
},
{
"name": "moment.js",
"path": "moment.js",
"contentType": "file"
},
{
"name": "package-lock.json",
"path": "package-lock.json",
"contentType": "file"
},
{
"name": "package.js",
"path": "package.js",
"contentType": "file"
},
{
"name": "package.json",
"path": "package.json",
"contentType": "file"
}
],
"templateDirectorySuggestionUrl": null,
"readme": null,
"totalCount": 37,
"showBranchInfobar": false
},
"fileTree": null,
"fileTreeProcessingTime": null,
"foldersToFetch": [],
"treeExpanded": false,
"symbolsExpanded": false,
"isOverview": true,
"overview": {
"banners": {
"shouldRecommendReadme": false,
"isPersonalRepo": false,
"showUseActionBanner": false,
"actionSlug": null,
"actionId": null,
"showProtectBranchBanner": false,
"recentlyTouchedDataChannel": null,
"publishBannersInfo": {
"dismissActionNoticePath": "/settings/dismiss-notice/publish_action_from_repo",
"releasePath": "/moment/moment/releases/new?marketplace=true",
"showPublishActionBanner": false
},
"interactionLimitBanner": null,
"showInvitationBanner": false,
"inviterName": null
},
"codeButton": {
"contactPath": "/contact",
"isEnterprise": false,
"local": {
"protocolInfo": {
"httpAvailable": true,
"sshAvailable": null,
"httpUrl": "https://github.com/moment/moment.git",
"showCloneWarning": null,
"sshUrl": null,
"sshCertificatesRequired": null,
"sshCertificatesAvailable": null,
"ghCliUrl": "gh repo clone moment/moment",
"defaultProtocol": "http",
"newSshKeyUrl": "/settings/ssh/new",
"setProtocolPath": "/users/set_protocol"
},
"platformInfo": {
"cloneUrl": "https://desktop.github.com",
"showVisualStudioCloneButton": false,
"visualStudioCloneUrl": "https://windows.github.com",
"showXcodeCloneButton": false,
"xcodeCloneUrl": "https://developer.apple.com",
"zipballUrl": "/moment/moment/archive/refs/heads/develop.zip"
}
},
"newCodespacePath": "/codespaces/new?hide_repo_select=true&repo=1424470"
},
"popovers": {
"rename": null,
"renamedParentRepo": null
},
"commitCount": "4,064",
"overviewFiles": [
{
"displayName": "README.md",
"repoName": "moment",
"refName": "develop",
"path": "README.md",
"preferredFileType": "readme",
"tabName": "README",
"richText": "<article class=\"markdown-body entry-content container-lg\" itemprop=\"text\"><h1 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-momentjs\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#momentjs\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a><a href=\"http://momentjs.com/\" rel=\"nofollow\">Moment.js</a></h1>\n<p dir=\"auto\"><a href=\"https://npmjs.org/package/moment\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/63616aea46f76ebb59438d57aa881387c43ed9f0e69e08a65b1babf545228e18/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f6d6f6d656e742e7376673f7374796c653d666c6174\" alt=\"NPM version\" data-canonical-src=\"https://img.shields.io/npm/v/moment.svg?style=flat\" style=\"max-width: 100%;\"></a>\n<a href=\"https://npmcharts.com/compare/moment?minimal=true\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/6bdfa58c034a412b4e30b1d2d56f848b35b626af180f578f014c24ec158b1166/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f6d6f6d656e742e7376673f7374796c653d666c6174\" alt=\"NPM downloads\" data-canonical-src=\"https://img.shields.io/npm/dm/moment.svg?style=flat\" style=\"max-width: 100%;\"></a>\n<a href=\"/moment/moment/blob/develop/LICENSE\"><img src=\"https://camo.githubusercontent.com/0e22ab646ad5e4c332e4dc554ab4d73bea325370dc543c297da85fde11a7e11e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174\" alt=\"MIT License\" data-canonical-src=\"https://img.shields.io/badge/license-MIT-blue.svg?style=flat\" style=\"max-width: 100%;\"></a>\n<a href=\"https://travis-ci.org/moment/moment\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/6fcd2d23125446b47055ab3ce05580ed72b9bf901039e64af339ef3abe79d720/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d6f6d656e742f6d6f6d656e742f646576656c6f702e7376673f7374796c653d666c6174\" alt=\"Build Status\" data-canonical-src=\"https://img.shields.io/travis/moment/moment/develop.svg?style=flat\" style=\"max-width: 100%;\"></a>\n<a href=\"https://coveralls.io/r/moment/moment?branch=develop\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/f630f6b30f6624319cca80f0e0ff4affdd8b2b15480950a26c40deb762fff5a3/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d6f6d656e742f6d6f6d656e742f62616467652e7376673f6272616e63683d646576656c6f70\" alt=\"Coverage Status\" data-canonical-src=\"https://coveralls.io/repos/moment/moment/badge.svg?branch=develop\" style=\"max-width: 100%;\"></a>\n<a href=\"https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoment%2Fmoment?ref=badge_shield\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/c024b76978139d1f2fe2d52f6ff52839898351d0930359ed2ef8b3cfa8fec26c/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f67697425324268747470732533412532462532466769746875622e636f6d2532466d6f6d656e742532466d6f6d656e742e7376673f747970653d736869656c64\" alt=\"FOSSA Status\" data-canonical-src=\"https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoment%2Fmoment.svg?type=shield\" style=\"max-width: 100%;\"></a>\n<a href=\"https://dependabot.com/compatibility-score.html?dependency-name=moment&amp;package-manager=npm_and_yarn&amp;version-scheme=semver\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/43b232bdff948ff609bf6b1f655ddd3a70df0544accbf309652d70854f9aaa11/68747470733a2f2f6170692e646570656e6461626f742e636f6d2f6261646765732f636f6d7061746962696c6974795f73636f72653f646570656e64656e63792d6e616d653d6d6f6d656e74267061636b6167652d6d616e616765723d6e706d5f616e645f7961726e2676657273696f6e2d736368656d653d73656d766572\" alt=\"SemVer compatibility\" data-canonical-src=\"https://api.dependabot.com/badges/compatibility_score?dependency-name=moment&amp;package-manager=npm_and_yarn&amp;version-scheme=semver\" style=\"max-width: 100%;\"></a></p>\n<p dir=\"auto\">A JavaScript date library for parsing, validating, manipulating, and formatting dates.</p>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-project-status\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#project-status\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Project Status</h2>\n<p dir=\"auto\">Moment.js is a legacy project, now in maintenance mode. In most cases, you should choose a different library.</p>\n<p dir=\"auto\">For more details and recommendations, please see <a href=\"https://momentjs.com/docs/#/-project-status/\" rel=\"nofollow\">Project Status</a> in the docs.</p>\n<p dir=\"auto\"><em>Thank you.</em></p>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-resources\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#resources\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Resources</h2>\n<ul dir=\"auto\">\n<li><a href=\"https://momentjs.com/docs/\" rel=\"nofollow\">Documentation</a></li>\n<li><a href=\"/moment/moment/blob/develop/CHANGELOG.md\">Changelog</a></li>\n<li><a href=\"https://stackoverflow.com/questions/tagged/momentjs\" rel=\"nofollow\">Stack Overflow</a></li>\n</ul>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-license\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#license\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>License</h2>\n<p dir=\"auto\">Moment.js is freely distributable under the terms of the <a href=\"/moment/moment/blob/develop/LICENSE\">MIT license</a>.</p>\n<p dir=\"auto\"><a href=\"https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoment%2Fmoment?ref=badge_large\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/c204a49066b5fb623db2c8bb17a85688d9f6c58b430e2422082b548df6b582b6/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f67697425324268747470732533412532462532466769746875622e636f6d2532466d6f6d656e742532466d6f6d656e742e7376673f747970653d6c61726765\" alt=\"FOSSA Status\" data-canonical-src=\"https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoment%2Fmoment.svg?type=large\" style=\"max-width: 100%;\"></a></p>\n</article>",
"loaded": true,
"timedOut": false,
"errorMessage": null,
"headerInfo": {
"toc": [
{
"level": 1,
"text": "Moment.js",
"anchor": "momentjs",
"htmlText": "Moment.js"
},
{
"level": 2,
"text": "Project Status",
"anchor": "project-status",
"htmlText": "Project Status"
},
{
"level": 2,
"text": "Resources",
"anchor": "resources",
"htmlText": "Resources"
},
{
"level": 2,
"text": "License",
"anchor": "license",
"htmlText": "License"
}
],
"siteNavLoginPath": "/login?return_to=https%3A%2F%2Fgithub.com%2Fmoment%2Fmoment"
}
},
{
"displayName": "LICENSE",
"repoName": "moment",
"refName": "develop",
"path": "LICENSE",
"preferredFileType": "license",
"tabName": "MIT",
"richText": null,
"loaded": false,
"timedOut": false,
"errorMessage": null,
"headerInfo": {
"toc": null,
"siteNavLoginPath": "/login?return_to=https%3A%2F%2Fgithub.com%2Fmoment%2Fmoment"
}
}
],
"overviewFilesProcessingTime": 15.552659
}
},
"appPayload": {
"helpUrl": "https://docs.github.com",
"findFileWorkerPath": "/assets-cdn/worker/find-file-worker-32bb159cc57c.js",
"findInFileWorkerPath": "/assets-cdn/worker/find-in-file-worker-c6704d501c10.js",
"githubDevUrl": null,
"enabled_features": {
"code_nav_ui_events": false,
"copilot_conversational_ux": false,
"copilot_conversational_ux_embedding_update": false,
"copilot_popover_file_editor_header": false,
"copilot_smell_icebreaker_ux": true,
"copilot_workspace": false,
"codeview_firefox_inert": true
}
}
}
}
{
"accept-ranges": "bytes",
"cache-control": "max-age=0, private, must-revalidate",
"content-encoding": "gzip",
"content-security-policy": "default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com api.githubcopilot.com objects-origin.githubusercontent.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/",
"content-type": "text/html; charset=utf-8",
"date": "Mon, 26 Feb 2024 10:58:18 GMT",
"etag": "1df290e344bd6a0d47acb78a90dcf950",
"referrer-policy": "no-referrer-when-downgrade",
"server": "GitHub.com",
"set-cookie": "logged_in=no; Path=/; Domain=github.com; Expires=Wed, 26 Feb 2025 10:58:18 GMT; HttpOnly; Secure; SameSite=Lax",
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
"transfer-encoding": "chunked",
"vary": "X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With",
"x-content-type-options": "nosniff",
"x-frame-options": "deny",
"x-github-request-id": "BDDE:2E19:32DA896:47E3D1D:65DC6ECA",
"x-xss-protection": "0"
}