You are here

function jalalidate_default_timezone in PersianTools 7

1 call to jalalidate_default_timezone()
jalalidate_convert in includes/jalalidate_lib.inc
Convert given time to Jalali calendar. Two different formats need to be handled. When using PHP's internal date conversion, the formats follow the pattern explained here: http://userguide.icu-project.org/formatparse/datetime Otherwise the date…

File

includes/jalalidate_lib.inc, line 120

Code

function jalalidate_default_timezone($check_user = TRUE) {
  global $user;
  if ($check_user && variable_get('configurable_timezones', 1) && !empty($user->timezone)) {
    return $user->timezone;
  }
  else {
    $default = variable_get('date_default_timezone', '');
    return empty($default) ? 'Asia/Tehran' : $default;
  }
}