public static function jDateTime::createTimeZone in Persian Date for Drupal 8 8.4
Parameters
null $timezone:
Return value
\DateTimeZone|null
1 call to jDateTime::createTimeZone()
- jDateTime::createDateTime in src/Library/ Jalali/ jDateTime.php 
File
- src/Library/ Jalali/ jDateTime.php, line 862 
Class
- jDateTime
- Class jDateTime @package Morilog\Jalali
Namespace
Drupal\persian_date\Library\JalaliCode
public static function createTimeZone($timezone = null) {
  if ($timezone instanceof \DateTimeZone) {
    return $timezone;
  }
  if ($timezone === null) {
    return new \DateTimeZone(date_default_timezone_get());
  }
  if (is_string($timezone)) {
    return new \DateTimeZone($timezone);
  }
  throw new \InvalidArgumentException('timezone is not valid');
}