PHP code example of hekmatinasser / verta

1. Go to this page and download the library: Download hekmatinasser/verta 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/ */

    

hekmatinasser / verta example snippets


echo verta(); //1401-05-24 00:00:00

echo verta('2022-08-15'); //1401-05-24 00:00:00

echo Verta::parse('1401-05-24 14:12:32')->datetime(); //2022-08-15 00:00:00

echo now()->toJalali(); //1401-05-24 00:00:00

echo verta()->toCarbon(); //2022-08-15 00:00:00

$v = verta(); // 1396-03-14 14:18:23
echo $v->year; // 1396

$v = verta(); // 1396-03-14 14:18:23
echo $v->year = 1395;

$v = verta(); // 1396-03-14 14:18:23
echo $v->setTimeString('12:25:45');

echo verta()->format('Y.m.d'); // 1401.05.24
echo verta()->formatWord('l dS F'); // دوشنبه بیست و چهارم مرداد

echo verta()->formatJalaliDatetime(); // output 1395/10/07 14:12:25

echo verta('-13 month')->formatDifference(); // 1 سال قبل

echo verta()->addWeeks(3); 
...

echo verta()->startWeek(3); 

echo verta('+2 day')->gte('2022-08-15');

echo verta('+13 day')->diffMonths('2022-08-15'); 

echo Verta::isLeapYear(1394); // false

Verta::setLocale('ar');

'birthday' => ['