1. Go to this page and download the library: Download dipesh/nepali-date 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/ */
dipesh / nepali-date example snippets
$date = new NepaliDate('1994/01/21');
//or
$date = new NepaliDate();
// Suported format Y, m, M, F, d, w, D, l, g
$date->toNepali()->format('Y-m-d'); // 2050-10-8
$date->toNepali()->format('Y F d g l'); // 2050 Magh 8 Gate Sukrabar
$date->isEqual('2048/10/5'); // return true or false
$date->isGreaterThan('2048/10/5');
$date->isGreaterThanOrEqual('2048/10/5');
$date->isLessThan('2048/10/5');
$date->isLessThanOrEqual('2048/10/5');
$date->toNepali()->lang('np')->format('Y-m-d'); // २०५०-१०-८
$date->toNepali()->lang('np')->format('Y F d g l'); // २०५० माघ ८ गते शुक्रबार
//You can also add your own language
$date->toNepali()->lang(function($lang) {
return $lang; // Provide your own language array
})->format('Y F d g l');