import re


def parse_changelog(filename, version):
    """Parse Debian syntax changelog files and return last date.

    Args:
        filename: filename of changelog
    Returns:
        date in the format day-of-week, dd month yyyy hh:mm:ss +zzzz or -1
    """
    check_line = False
    with open(filename, 'r') as changelog:
        for line in changelog.readlines():
            if check_line:
                if re.match(r'^ .*<.*@.*>  [A-Z][a-z][a-z], [0-9][0-9]', line):
                    return re.split(r'^ .*<.*@.*>', line)[1].strip()
            else:
                m = re.match(r'^.* \((.*)\)', line)
                if m:
                    if m.groups()[0] == version:
                        check_line = True