zein/hijri

extended hijri date library from nazir/go2hi with carbon syntax style

v1.0.0 2022-06-09 05:33 UTC

This package is auto-updated.

Last update: 2024-05-09 09:39:27 UTC


README

extended hijri date library from nazir/go2hi with nesbot/carbon syntax style

Example

<?php
require __DIR__ . '/vendor/autoload.php';

use Zein\Hijri\Hijri;

echo Hijri::now(); // get current date in hijri
// output : 09 Dzul Qa'dah 1443

echo Hijri::yesterday(); // yesterday
// output : 08 Dzul Qa'dah 1443

echo Hijri::yesterday(); // tomorrow
// output : 10 Dzul Qa'dah 1443

echo Hijri::now()->format('Y-m-d'); // tomorrow
// output : 1443-11-09

echo Hijri::get(15)->day()->ago(); // get 15 day ago
echo Hijri::get(1)->month()->ago(); // get 1 month ago
echo Hijri::get(2)->year()->ago(); // get 2 year ago
?>