Packet history in Ubuntu

Trying to figure out what packages has been changed since a specific date. A quick hack.

package_history() {
    local since="${1}"
    local action="${2:-install}"
    action=${action,,}
    action=${action^}

    [[ -z "${since}" ]] && { echo "Need a valid date as first argument"; exit -1; }

    sed -n '/^Start-Date: '"${since}"' /,$p' /var/log/apt/history.log | awk '/Start-Date:/ || /'"${action}"':/' | sed -r 's|\),|\)\n|g; s|('"${action}"': )|\1\n |'
}

Examples, if you want to know all packages installed since 2016-05-17:
package_history "2016-05-17"

If you want to know all packages removed since 2016-05-09:
package_history "2016-05-17" remove