moment
Dealing with dates and times should be easy
What it is and what it does
Moment is a wrapper around Python's datetime that provides a fluent, chainable API for date and time manipulation inspired by Moment.js. It uses dateparser to handle natural-language date strings like "2 weeks ago" or "December 18, 2012", and integrates pytz for timezone handling. You can parse dates from strings, Unix timestamps, or datetime objects; add or subtract time units; replace specific components; and format output using either Moment.js-style or strftime-style format strings.
The package is explicitly marked as beta-quality software and has been abandoned since 2020, with the maintainer recommending arrow or pendulum as alternatives in the installation documentation. It supports Python 2.7 and 3.6–3.7 according to its classifiers, and has received no updates in over five years despite having 741 GitHub stars.
Use it for:
- Parse user-friendly date strings like "next Monday" or "3 days ago" without manual format specification
- Chain date operations (add weeks, subtract days, replace hours) in a single readable expression
- Convert between timezones and format dates for display using Moment.js-compatible format strings
- Build date arithmetic into scripts where readability matters more than raw performance
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python library for parsing, manipulating, and formatting dates and times with a fluent API inspired by Moment.js, using dateparser, pytz, and times under the hood.
No. While the package has low install friction and a permissive license, it is abandoned (last release 2020-11-27, no commits since 2023-04-24) and explicitly marked as beta-quality. The maintainer recommends arrow or pendulum instead. For new projects, choose an actively maintained alternative; for legacy code already using moment, consider migrating to reduce long-term maintenance risk.
Install
moment on PyPI
pip
pip install momentuv
uv add momentpoetry
poetry add momentInstalling moment
Before you install
Low install friction with a pure-Python wheel, but the package is abandoned as of 2020-11-27 with no commits since 2023-04-24. The last release was over 5 years ago and the project is marked as beta-quality software. The maintainer's own documentation recommends considering arrow or pendulum as alternatives.
License in practice
MIT license is permissive and imposes no restrictions on commercial or private use, modification, or distribution, only requiring attribution.
Quickstart
pip install moment
import moment
# Parse a natural-language date string
moment.date("2 weeks ago")
# Chain operations and format
moment.now().add(days=5).format("YYYY-M-D")
Verify before relying
- Whether the package's dependencies (dateparser, pytz, times) are themselves maintained and compatible with current Python versions
- Whether the abandoned status and lack of updates since 2020 create compatibility issues with modern Python or dependency versions
- How well the package handles edge cases in date parsing compared to actively maintained alternatives
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — dateparser, pytz, times |
| Maintenance | abandoned — 2,086 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 310,094/month — #7,748 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: moment-0.12.1-py3-none-any.whl
Keywords: moment, dates, times, zachwill
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
arrowArrow provides a simpler, more intuitive API…
permissive · top 1,000 on PyPI
Flask-MomentFlask-Moment adds moment.js date and time…
permissive · top 15,000 on PyPI
timeagoFormats datetime objects and timedeltas into…
permissive · top 5,000 on PyPI
pytzpytz brings the Olson timezone database into…
permissive · top 100 on PyPI
pendulumPendulum provides an enhanced datetime API for…
permissive · top 1,000 on PyPI
metomi-isodatetimeParses and manipulates ISO 8601 date-time…
copyleft · top 15,000 on PyPI
isodateParses and formats ISO 8601 date, time,…
permissive · top 1,000 on PyPI
reflex-components-momentProvides Reflex UI components for moment-based…
permissive · top 15,000 on PyPI
jinja2-timeJinja2 extension that adds template tags for…
permissive · top 5,000 on PyPI
agoConverts datetime, timedelta, and timestamp…
permissive · top 15,000 on PyPI