<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _get_pkg_build_time(name):
    '''
    Get package build time, if possible.

    :param name:
    :return:
    '''
    iso_time = iso_time_t = None
    changelog_dir = os.path.join('/usr/share/doc', name)
    if os.path.exists(changelog_dir):
        for fname in os.listdir(changelog_dir):
            try:
                iso_time_t = int(os.path.getmtime(os.path.join(changelog_dir, fname)))
                iso_time = datetime.datetime.utcfromtimestamp(iso_time_t).isoformat() + 'Z'
                break
            except OSError:
                pass

    # Packager doesn't care about Debian standards, therefore Plan B: brute-force it.
    if not iso_time:
        for pkg_f_path in __salt__['cmd.run']('dpkg-query -L {}'.format(name)).splitlines():
            if 'changelog' in pkg_f_path.lower() and os.path.exists(pkg_f_path):
                try:
                    iso_time_t = int(os.path.getmtime(pkg_f_path))
                    iso_time = datetime.datetime.utcfromtimestamp(iso_time_t).isoformat() + 'Z'
                    break
                except OSError:
                    pass

    return iso_time, iso_time_t