Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PHP
  3. Moment.php

Moment.php

NOASSERTIONPHP1.35.0

A PHP date library for parsing, validating, manipulating, and formatting dates with internationalization (i18n) support.

GitHubGitHub
968 stars151 forks0 contributors

What is Moment.php?

Moment.php is a PHP library for parsing, validating, manipulating, and formatting dates and times. It provides a fluent, chainable API inspired by moment.js, making complex date operations—like adding time intervals, switching timezones, and formatting dates in multiple languages—simple and intuitive. It solves the problem of cumbersome native PHP date handling by offering a more developer-friendly interface.

Target Audience

PHP developers who need robust date and time manipulation, especially those working on internationalized applications requiring localized date formatting and timezone management.

Value Proposition

Developers choose Moment.php for its moment.js-like API, extensive locale support, and comprehensive feature set that simplifies date handling beyond PHP's native DateTime class. Its chainable methods and flexibility in formatting and manipulation save development time and reduce errors.

Overview

Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js

Use Cases

Best For

  • Parsing and validating dates from various input formats (ISO8601, RFC, MySQL)
  • Formatting dates for international audiences with locale support
  • Manipulating dates by adding or subtracting time units (e.g., add 2 weeks, subtract 1 day)
  • Handling timezone conversions and setting default timezones
  • Calculating differences between dates and displaying human-readable relative times
  • Getting period boundaries for weeks, months, or quarters

Not Ideal For

  • Projects requiring active, long-term maintenance and frequent updates
  • High-performance applications where minimal date manipulation overhead is critical
  • Teams exclusively using modern PHP (7.4+) with native DateTimeImmutable sufficiency
  • Applications needing extensive third-party integrations or a large plugin ecosystem

Pros & Cons

Pros

Extensive Internationalization Support

Supports over 30 locales for localized date formatting and relative times, including Arabic, Chinese, and German, as listed in the README.

Intuitive Chainable API

Provides a fluent, moment.js-inspired interface allowing methods like addDays(7)->subtractHours(2) to be chained for easy manipulation.

Flexible Timezone Handling

Allows easy switching of timezones and setting default timezones globally, with examples for CET and UTC conversions in the README.

Comprehensive Date Features

Includes parsing multiple formats (ISO8601, RFC, MySQL), validation, period calculations, calendar times, and start/end of units, covering most common operations.

Cons

Uncertain Maintenance Future

The maintainer has publicly stated time constraints and is seeking someone to take over, risking unaddressed bugs or lack of updates for long-term projects.

Performance Overhead

As a wrapper over PHP's DateTime, it adds abstraction that may impact performance in date-intensive applications compared to direct native usage.

Limited Modern PHP Integration

While it supports PHP 5.3+, it may not fully leverage newer PHP features or optimizations, such as strict typing or immutable defaults in recent versions.

Frequently Asked Questions

Quick Stats

Stars968
Forks151
Contributors0
Open Issues17
Last commit9 months ago
CreatedSince 2012

Tags

#parsing#moment#date-time#timezone#internationalization#time#i18n#calendar#date#localization#date-parsing#php#date-formatting#formatter

Built With

P
PHP

Included in

PHP32.5k
Auto-fetched 9 hours ago

Related Projects

CarbonCarbon

A simple PHP API extension for DateTime.

Stars16,620
Forks1,294
Last commit1 day ago
ChronosChronos

A standalone DateTime library originally based off of Carbon

Stars1,361
Forks71
Last commit7 days ago
YasumiYasumi

The easy PHP Library for calculating holidays

Stars1,087
Forks167
Last commit2 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub