Convert from AD (Anno Domini) to Lunar (Chhankitek) format see more.
You can install the package via composer:
composer require asorasoft/chhankitek
// In Laravel controller, use this trait
use HasChhankitek;
// start call chhankitek method
$toLunarDate = $this->chhankiteck(Carbon::now());
$toLunarDate->toString(); // ថ្ងៃច័ន្ទ ៤ រោច ខែបឋមាសាឍ ឆ្នាំឆ្លូវ ត្រីស័ក ពុទ្ធសករាជ ២៥៦៥
// In Laravel controller, use this trait
use HasChhankitek;
$toLunarDate = $this->chhankiteck(Carbon::now());
$toLunarDate->getDayOfWeek(); // អាទិត្យ, ច័ន្ទ...
$toLunarDate->getLunarDay(); // ១កើត, ២កើត...
$toLunarDate->getLunarMonth(); // ចេត្រ...
$toLunarDate->getLunarZodiac(); // ជូត, ឆ្លូវ...
$toLunarDate->getLunarEra(); // ត្រីស័ក...
$toLunarDate->getLunarYear(); // ២៥៦៥, ២៥៦៦..
Or we can use toLunarDate
helper function.
toLunarDate(Carbon::now())->toString(); // ថ្ងៃច័ន្ទ ៤ រោច ខែបឋមាសាឍ ឆ្នាំឆ្លូវ ត្រីស័ក ពុទ្ធសករាជ ២៥៦៥
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email mabhelitc@gmail.com instead of using the issue tracker.
If you like this package and want to support me, you can buy me a coffee ☕
The MIT License (MIT). Please see License File for more information.
This library might not exist without hardwork of these people:
- Base on algorithm of
Mr.Phylypo Tum
from Cam-CC - Porting from momentkh by
ThyrithSor
intoJava
- Khmer New Year Time Calculation
- Porting from MetheaX/khmer-chhankitek-calendar by
MetheaX
intoLaravel Package