protected static function julian2jalali($julianDayNumber) {
        
        $gYear  = self::julian2georgian($julianDayNumber)[0];
        $year   = $gYear - static::HEGIRA_STARTING_YEAR;
        $parsed = self::parseJalali($year);
        $jdn1f  = self::georgian2julian($gYear, 3, $parsed['march']);
        
        // Find number of days that passed since 1 Farvardin.
        $passed = $julianDayNumber - $jdn1f;
        
        if ($passed >= 0) {
            if ($passed <= 185) {
                $month = 1 + self::division($passed, 31);
                $day   = ($passed % 31) + 1;
                
                return [$year, $month, $day];
            } else {
                $passed -= 186;
            }
        } else {
            $year   -= 1;
            $passed += 179;
            
            if ($parsed['leap'] === 1) {
                $passed += 1;
            }
        }
        
        $month = 7 + self::division($passed, 30);
        $day   = ($passed % 30) + 1;
        
        return [$year, $month, $day];
    }
protected static function julian2jalali($julianDayNumber) {
        
        $gYear  = self::julian2georgian($julianDayNumber)[0];
        $year   = $gYear - static::HEGIRA_STARTING_YEAR;
        $parsed = self::parseJalali($year);
        $jdn1f  = self::georgian2julian($gYear, 3, $parsed['march']);
        
        // Find number of days that passed since 1 Farvardin.
        $passed = $julianDayNumber - $jdn1f;
        
        if ($passed >= 0) {
            if ($passed <= 185) {
                $month = 1 + self::division($passed, 31);
                $day   = ($passed % 31) + 1;
                
                return [$year, $month, $day];
            } else {
                $passed -= 186;
            }
        } else {
            $year   -= 1;
            $passed += 179;
            
            if ($parsed['leap'] === 1) {
                $passed += 1;
            }
        }
        
        $month = 7 + self::division($passed, 30);
        $day   = ($passed % 30) + 1;
        
        return [$year, $month, $day];
    }
protected static function julian2jalali ( $ julianDayNumber ) { $ gYear = self :: julian2georgian ( $ julianDayNumber ) [ 0 ] ; $ year = $ gYear - static :: HEGIRA_STARTING_YEAR ; $ parsed = self :: parseJalali ( $ year ) ; $ jdn1f = self :: georgian2julian ( $ gYear , 3 , $ parsed [ 'march' ] ) ; // Find number of days that passed since 1 Farvardin. $ passed = $ julianDayNumber - $ jdn1f ; if ( $ passed >= 0 ) { if ( $ passed <= 185 ) { $ month = 1 + self :: division ( $ passed , 31 ) ; $ day = ( $ passed % 31 ) + 1 ; return [ $ year , $ month , $ day ] ; } else { $ passed -= 186 ; } } else { $ year -= 1 ; $ passed += 179 ; if ( $ parsed [ 'leap' ] === 1 ) { $ passed += 1 ; } } $ month = 7 + self :: division ( $ passed , 30 ) ; $ day = ( $ passed % 30 ) + 1 ; return [ $ year , $ month , $ day ] ; }
Converts the Julian Day number to a date in the Jalali calendar.

@param int $julianDayNumber Julian Day number

@return array
0: Jalali year   (1 to 3100)
1: Jalali month  (1 to 12)
2: Jalali day    (1 to 29/31)
Converts the Julian Day number to a date in the Jalali calendar .