Thanks all for the suggestions.
Despite having the timezone set correctly, my pi was stuck on a particular date and time. Here is what I did to get the time corrected.
sudo apt update; sudo apt install ntpdate
sudo systemctl stop ntp
sudo ntpdate -s pool.ntp.org
After that, the time showed correctly and I was able to download and install the package.
The source is a comment on this thread.
https://www.reddit.com/r/RetroPie/comments/56ehgc/pi_3_date_and_time_not_setting/A Reddit user named
suprjami posted this as an explanation of the above command logic:
No worries mate, more than happy to help and glad to hear it's working well for you
sudo apt update
This refreshes the package manager, so if you search or download packages, you get the latest versions of any package you use.
sudo apt install ntpdate
This tells the package manager to install the ntpdate package, which contains the ntpdate program. This program can set the system clock by querying an NTP time server.
sudo systemctl stop ntp
This stops the background NTP service. We need to stop it because we can't manually update the system clock using ntpdate while the NTP service is trying to update the system clock as well.
Raspbian comes with this background NTP service enabled by default and it really should be already working and updating the time for you, but it's not for some reason.
sudo ntpdate -s pool.ntp.org
This uses the ntpdate program we installed prior, queries a freely available community time server in the NTP Pool project and uses that reliable internet time server to set the system clock.
still good after reboots as well!
That's actually quite surprising, I expected if you rebooted then the clock would reset back to the old value. I'm honestly not sure why the background NTP service wasn't working for you before sorry. Maybe NTP had something "stuck" on an old value and just needed a little manual jog forward? I don't know the NTP service and its operation that deeply sorry.