Blog Featured Bigsur Terminal

How to Change Date in macOS via Terminal

Rafal KuklaApple

So have you had an error message while updating, or reinstalling your macOS recently? You are one of the few thousands of people that visit this blog post each month, so don't worry, you are not alone and this solution is most likely for you.
Installation Failed An error occurred while preparing the installation. Try running again.
This error above indicates that your Apple Mac system date is incorrect. This is a common problem if your laptop runs out of battery for a more extended period of time. Ok let's dive in.

In this article you will learn:

How to Change Date via Terminal
Summary

How to Change Date via Terminal

Make sure you are in Recovery Mode. If you not sure how to do that, let me give you a little reminder. Immediately hold down the Command and R keys until you see an Apple logo or spinning globe after restarting your Apple computer.

If you see a spinning globe, your Mac is trying to start macOS Recovery via the internet because it cannot start from the built-in recovery system

While in the Recovery mode, cancel the installation process, and navigate to Utilities and open the Terminal app and type Date to check current date.
You should see something like this:

Terminal Date
If your time and date are incorrect, use the following command to set up a correct date to continue with the installation or upgrade of your macOS Big Sur or any other previous macOS releases. This command should work on any macOS.
date {month}{day}{hour}{minute}{year}

Every bracket should be replaced with a two-digit number that represent current time and date.

So for example; February 6th 2021 13:45 would become the following command:

date 0206134521
Final step, hit Enter on your keyboard to apply date via terminal. You can then check if it was set correctly by running the first command again date.

Summary

That's all. Hopefully, you learnt something new today, and this solution has resolved your problem with macOS installation, if not, please reach out or comment below.
If you enjoyed this article and you would like to be notified when my next article or blog is out, feel free to put your name and email below. Thanks 😃