PHP code example of derakht / jalali
1. Go to this page and download the library: Download derakht/jalali 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/ */
derakht / jalali example snippets
use derakht\Jalali\Jalali;
Jalali::parse('2022-01-01')->toJalaliDateString(); // 1400/10/11
Jalali::parse('2022-01-01')->toJalaliDateTimeString(); // 1400/10/11 00:00:00
Jalali::parseJalali('1400/01/01')->toDateString(); // 2021-03-21
Jalali::parseJalali('1400/01/01')->addDay()->toDateString(); // 2021-03-22
Jalali::parseJalali('1400/06/31')->addJalaliMonth()->toJalaliDateString(); // 1400/07/30