Analysis updated 2026-06-24
Add or subtract days, weeks, or months from a date in a PHP app
Show a timestamp as a human phrase like 2 minutes ago in many languages
Mock the current time in unit tests for date-dependent logic
Convert between time zones when displaying user timestamps
| briannesbitt/carbon | flarum/flarum | koel/koel | |
|---|---|---|---|
| Stars | 16,617 | 16,274 | 17,135 |
| Language | PHP | PHP | PHP |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 3/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
briannesbitt/Carbon is a PHP library that makes working with dates and times much easier than using PHP's built-in tools alone. PHP has a built-in "DateTime" class for handling dates and times, but it can be clunky to use for common tasks. Carbon extends that class with a much friendlier set of methods, simple English-style calls that let you do things like add a day, subtract a week, compare two dates, or format a timestamp. The code examples in the README demonstrate the style well: you can get the current time with Carbon::now(), add a day with ->addDay(), subtract a week with ->subWeek(), get a person's age from a birthdate, and express time differences in plain language like "2 minutes ago." It supports over 200 languages and 500 regional variants, so that "2 minutes ago" message can be displayed in Chinese, French, or dozens of other languages automatically. It also includes a useful feature for testing: you can tell Carbon to pretend the current time is a specific date. This lets you write automated tests that check date-dependent logic without waiting for real time to pass or hardcoding fake dates throughout your code. Carbon is written in PHP and installed via Composer, which is the standard PHP package manager. You would use it in any PHP project where you need to do date arithmetic, format dates for display, compare timestamps, or handle time zones, common needs in web apps, scheduling systems, or anything that tracks events over time.
A PHP library that makes working with dates and times easier than the built-in DateTime class, with English-style methods, time zones, and 200+ languages.
Mainly PHP. The stack also includes PHP, Composer, DateTime.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.