PHP code example of cambodev / date-converter

1. Go to this page and download the library: Download cambodev/date-converter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cambodev / date-converter example snippets


'timezone' => 'Asia/Phnom_Penh',

CamboDev\DateConverter\ConverterServiceProvider::class,
'KmFormat' => CamboDev\DateConverter\KmFormatFacade::class,

$date = date('Y-m-d H:i:s');
$dateTime  = KmFormat::to($date)->format("LLLL");

echo $dateTime;

$dateTime  = KmFormat::to($date);
$dateTime->day(); // ២២
$dateTime->fullDay(); // ពុធ
$dateTime->month(); // ០៥
$dateTime->fullMonth(); // ឧសភា
$dateTime->year(); // ២០១៩
$dateTime->minute(); // ០០
$dateTime->hour(); // ០០
$dateTime->meridiem(); // ព្រឹក
$dateTime->week(); // ៤
$dateTime->fullWeek(); // សប្តាហ៍ទី៤
$dateTime->weekOfYear(); // ២១
$dateTime->fullWeekOfYear(); // សប្តាហ៍ទី២១
$dateTime->quarter(); // ២
$dateTime->fullQuarter(); // ត្រីមាសទី២