PHP Classes

Laravel Hijri Date Conversion: Convert dates from the Hijri to Gregorian calendar

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-09-26 (11 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 18 All time: 11,311 This week: 660Up
Version License PHP version Categories
hij 1.0.0The PHP License7Time and Date, PHP 7
Description 

Author

This class can convert dates from the Hijri to the Gregorian calendar.

It provides a simple class example that can take a date in the Hijri calendar and convert it to the same date in the Gregorian calendar.

The class returns the converted date as a string with the Y-m-d format.

Picture of Ahmed Abdulla
  Performance   Level  
Name: Ahmed Abdulla <contact>
Classes: 11 packages by
Country: Bahrain Bahrain
Age: 42
All time rank: 35232 in Bahrain Bahrain
Week rank: 37 Up1 in Bahrain Bahrain Up
Innovation award
Innovation award
Nominee: 1x

Recommendations

Recommendation for a PHP class to convert shamsi date to gregori
How to convert hajri shamsi date to gregorian date

Example

use App\HijriShamsiConverter;

class YourController extends Controller
{
    public function convertDate()
    {
        $hijriDate = '1444/01/01'; // Replace with your Hijri Shamsi date
        $gregorianDate = HijriShamsiConverter::hijriToGregorian($hijriDate);

        // $gregorianDate will now contain the converted Gregorian date
    }
}


Details

  • Install the package using Composer

composer require kamalkhan/islamic-date

  • Create a new class to handle the conversion. You can place this class in the app directory of your Laravel application ( app/HijriShamsiConverter.php )
  • Usage in your Laravel application ( code.php )

  Files folder image Files (3)  
File Role Description
Accessible without login Plain text file code.php Example Example usage in a Laravel controller or service
Plain text file HijriShamsiConverter.php Class Create a new class in Laravel application.
Accessible without login Plain text file readme.txt Doc. readme

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:18
This week:0
All time:11,311
This week:660Up