src/TimeType.php
public function getYear()
    {
        if ($this->value !== null) {
            preg_match('/^(?P<year>[0-9]{4,4})-(?P<month>[0-9]{2,2})-(?P<day>[0-9]{2,2}) (?P<hour>[0-9]{2,2}):(?P<minute>[0-9]{2,2}):(?P<second>[0-9]{2,2})$/ui', $this->value, $m);
            return (int) $m['year'];
        }
    }
public function getYear()
    {
        if ($this->value !== null) {
            preg_match('/^(?P<year>[0-9]{4,4})-(?P<month>[0-9]{2,2})-(?P<day>[0-9]{2,2}) (?P<hour>[0-9]{2,2}):(?P<minute>[0-9]{2,2}):(?P<second>[0-9]{2,2})$/ui', $this->value, $m);
            return (int) $m['year'];
        }
    }
Returns the year

@return int|null