Morilog\Jalali\jDateTime::toJalali PHP Method

toJalali() public static method

Converts a Gregorian date to Jalali.
public static toJalali ( $gy, $gm, $gd ) : array
$gy
$gm
$gd
return array 0: Year 1: Month 2: Day
    public static function toJalali($gy, $gm, $gd)
    {
        return self::d2j(self::g2d($gy, $gm, $gd));
    }

Usage Example

Exemplo n.º 1
0
 public function testToJalali()
 {
     $this->assertTrue(jDateTime::toJalali(2016, 5, 7) === [1395, 2, 18]);
     $this->assertFalse(jDateTime::toJalali(2015, 5, 7) === [1394, 2, 18]);
 }