PHPackages                             chanthorn/carbon-kh - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chanthorn/carbon-kh

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chanthorn/carbon-kh
===================

Covert Date to Khmer Lunar date

v2.1(11mo ago)4826[1 issues](https://github.com/chanthornsp/CarbonKh/issues)MITPHPPHP &gt;=7.2

Since Aug 31Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/chanthornsp/CarbonKh)[ Packagist](https://packagist.org/packages/chanthorn/carbon-kh)[ RSS](/packages/chanthorn-carbon-kh/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (1)Versions (10)Used By (0)

Khmer Lunar Date with Carbon
============================

[](#khmer-lunar-date-with-carbon)

Installation
============

[](#installation)

```
composer require chanthorn/carbon-kh
```

Usage
=====

[](#usage)

```
require_once __DIR__ . '/vendor/autoload.php';

use Carbon\Carbon;
use Chanthorn\CarbonKh\ToKhmerDate;

    $date = Carbon::parse('2023-01-01');
    $khmerDate = new ToKhmerDate($date);

    echo $khmerDate::format(); // ថ្ងៃអាទិត្យ ១០កើត ខែបុស្ស ឆ្នាំខាល ចត្វាស័ក ពុទ្ធសករាជ ២៥៦៦
    echo $khmerDate::format('dN ថ្ងៃW ខែm ព.ស. b'); // ១០កើត ថ្ងៃអាទិត្យ ខែបុស្ស ព.ស. ២៥៦៦

    print_r($khmerDate::khNewYear());
    // array:3 [
    //   "date" => Carbon\Carbon
    //   "days" => 3
    //   "dates" => array:3
    // ]
```

Use Helper Function
===================

[](#use-helper-function)

```
require_once __DIR__ . '/vendor/autoload.php';

echo khmerDate('2024-01-01')->format();
//ថ្ងៃច័ន្ទ ៥រោច ខែមិគសិរ ឆ្នាំថោះ បញ្ចស័ក ពុទ្ធសករាជ ២៥៦៧

print_r(khmerDate('2024-01-01')::khNewYear());

print_r(KhmerNewYearDate(2024));
// array:3 [
//   "date" => Carbon\Carbon
//   "days" => 4
//   "dates" => array:4
// ]
```

Usage with Laravel
==================

[](#usage-with-laravel)

```
use Chanthorn\CarbonKh\ToKhmerDate;

    $date = Carbon::parse('2023-01-01');
    $khmerDate = new ToKhmerDate($date);

    echo $khmerDate::format(); // ថ្ងៃអាទិត្យ ១០កើត ខែបុស្ស ឆ្នាំខាល ចត្វាស័ករាជ ២៥៦៦
    echo $khmerDate::format('dN ថ្ងៃW ខែm ព.ស. b'); // ១០កើត ថ្ងៃអាទិត្យ ខែបុស្ស ព.ស. ២៥៦៦

    print_r($khmerDate::khNewYear());
    // array:3 [
    //   "date" => Carbon\Carbon
    //   "days" => 3
    //   "dates" => array:3
    // ]
```

Format
------

[](#format)

Check out format [here](https://github.com/ThyrithSor/momentkh#format)

Authors
=======

[](#authors)

- This library is Ported from [khmercal](https://github.com/seanghay/khmercal) by [Seanghay](https://github.com/seanghay) and [momentkh](https://github.com/ThyrithSor/momentkh) by [Thyrith Sor](https://github.com/ThyrithSor) in to PHP.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance47

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~93 days

Recently: every ~163 days

Total

8

Last Release

337d ago

Major Versions

v1.0.5 → v2.02024-03-20

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13821332?v=4)[Chanthorn SP](/maintainers/chanthornsp)[@chanthornsp](https://github.com/chanthornsp)

---

Top Contributors

[![chanthornsp](https://avatars.githubusercontent.com/u/13821332?v=4)](https://github.com/chanthornsp "chanthornsp (17 commits)")

---

Tags

khmerkhmer-calendarkhmer-chhankitek-calendarkhmer-lunardatetimecarbonlunarKhmer dateKhmer Lunar dateCarbon Khmer

### Embed Badge

![Health badge](/badges/chanthorn-carbon-kh/health.svg)

```
[![Health](https://phpackages.com/badges/chanthorn-carbon-kh/health.svg)](https://phpackages.com/packages/chanthorn-carbon-kh)
```

###  Alternatives

[morilog/jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in PHP applications, based on Jalali (Shamsi) DateTime class.

9201.2M45](/packages/morilog-jalali)[kylekatarnls/laravel-carbon-2

Carbon 2 adapter for Laravel

631.2M1](/packages/kylekatarnls-laravel-carbon-2)[geoffreyrose/us-holidays

US Holidays Wrapper for the Carbon DateTime Library.

62717.0k2](/packages/geoffreyrose-us-holidays)[rovangju/carbon-nbd

Carbon DateTime extension to calculate the "next business day"

2125.4k](/packages/rovangju-carbon-nbd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
