jDateTime::__construct PHP Method

__construct() public method

Pass these parameteres when creating a new instance of this Class, and they will be used as defaults. e.g $obj = new jDateTime(false, true, 'Asia/Tehran'); To use system defaults pass null for each one or just create the object without any parameters.
Author: Sallar Kaboli
public __construct ( $convert = null, $jalali = null, $timezone = null )
$convert bool Converts numbers to Farsi
$jalali bool Converts date to Jalali
$timezone string Timezone string
    public function __construct($convert = null, $jalali = null, $timezone = null)
    {
        if ($jalali !== null) {
            self::$jalali = (bool) $jalali;
        }
        if ($convert !== null) {
            self::$convert = (bool) $convert;
        }
        if ($timezone !== null) {
            self::$timezone = $timezone;
        }
    }

Usage Example

Beispiel #1
0
 function __construct($convert = null, $jalali = null, $timezone = null)
 {
     // TODO: Implement __construct() method.
     parent::__construct($convert, $jalali, $timezone);
 }