After searching for how to fix this after I had erased my drive leaving me with no system, I have figured out how to fix it without having to download the installer again.
What I did:
With a USB installer connected, restart your Mac and hold the Option
key to get to your boot selection screen.
Select the Install MacOS Mojave
option.
DISCONNECT FROM THE INTERNET
If you do not disconnect, the system will update its clock from the servers.
(read: THIS WILL NOT WORK IF CONNECTED TO INTERNET)
After disconnecting, click on Utilities > Terminal
to open the Terminal.app.
In the command line, navigate to the root directory with:
cd /
In the root directory, list the contents.
ls
You should see the directory contents including Install MacOS Mojave.app
. You need to find out the date of that file. Type:
stat Install\ MacOS\ Mojave.app
(The name may be different but make sure you use the one shown on your screen and don't forget to escape the spaces with a forward slash.)
It's likely that there is only the one file named like that so an easier way to get it is by typing:
stat Install
and hitting Tab
to auto complete the filename. This should show some information of the file including a couple dates. You now want to set the date of your system to a date around when the installer was created therefore marking the certificate "valid". Lets say the date it was created was Mar 20, 13:45 2019
. We will set the date to the day before, Mar 19, 13:45 2019
. The format for setting the date is important and it is:
[mm][dd][HH][MM][yyyy]
No spaces. A single long number. To change the date to Mar 19, 13:45 2019
, use the date
command.
date 031913452019
Confirm the date change by running the date
command alone.
If successful, quit Terminal to return back to the main screen and try installing again. It should work this time.
When it gets to the stage of install asking you to enter your wifi or network information, it is okay now to do so as the installer has already been confirmed good.
I hope this is able to help others stuck in a similar situation.