Overtrue\Validation\Validator::validateTimezone PHP Method

validateTimezone() protected method

Validate that an attribute is a valid timezone.
protected validateTimezone ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
return boolean
    protected function validateTimezone($attribute, $value)
    {
        try {
            new DateTimeZone($value);
        } catch (\Exception $e) {
            return false;
        }
        return true;
    }
Validator