Changing system date from Terminal – OS X recovery

When you’re booting your Mac from the recovery partition and are planning to reinstall OS X, you might be met by the following message:

An error occurred while preparing the installation. Try running again

Now, if you haven’t used your Mac for a while, the error might be caused by an incorrect system date setting. You can check this by going to utilities and opening the terminal. Once in the terminal enter the following command and hit return/enter:


The result of this command will be the date that the system currently has been set to. For some reason, it might have been reset to 2001, in which case we need to set it to the right date. To do this, we enter a new command. This command will be entered as follows:

date -u {month}{day}{hour}{minute}{year}

Every bracket should be replaced with a two-digit number based on UTC time. Below you see what the command should be for your current time and date – . To avoid trouble with timezones, we will use UTC time instead (). Which means, you can just enter it exactly like this:

date -u 

Enter the command and hit return. You can then check if it was set correctly by running the first command again. If the date was wrong, it was likely that which caused the error, and after you quit the terminal it should be able to install OS X just fine.

Buying a Tesla? Use my referral link at the purchase of your new Model 3, S or X Read about Referral Program

I'm a webdeveloper based in Oslo, Norway. I currently work with web development at Nettmaker.

I would like to change the world, but they won't give me the source…


Hi. I have a huge problem, as I bought my Mac at an auction and it didn’t have a password for login, but once I wanted to fix the internet settings and so (the images didn’t load, browser only showed text-only pages and I kept getting notifications saying the connection is not secure), it asked for a password (the former owner’s login password). So I was advised online to restore/delete the disk to remove the password, so I did but I couldn’t reinstall the OS as the date was wrong. I fixed the date through the Terminal, but once I tried again with the OS install, it said the disk is locked!! Now I am stuck and cannot do anything….please help me…!

I used another Mac computer and created a High Sierra install folder on an external hard drive and connected it to the troubled Mac and installed the OS like on a new computer.

Thanks, this helped. The fact that while in recovery there is no way to tell system time doesn’t help…

hello i have bought a second hand macbook pro that was wiped buy the seller and now when i try to clean install the Os it always fails halfway the installation process . Model A1286, please help

You, my friend, Thomas. . ROCK
I’ve been trying and trying to fix my upgraded super charged MacBook. . All she needed was a time/date adjustment. . Stay brilliant friend

Very easy fix. Thank you

And, good idea with the current time script.

And, it may be my machine, but according to The time scripted above is an hour fast.

Above: 02:40 01:40

Thanks again

Right you are, thanks for letting me know Was using server-time. Switched it out to use the browser-time, in other words, the visitor’s local time. Please let me know if it still doesn’t look right for you!

Super helpful. Wasted 2 hours sorting this. Scary is your day, month, year, and time is exactly the same time while I was resetting mine. ?

You know what, the code I need couple minutes early, is exactly the line you write above, what an odds! Thanks!

Hello Everyone.

My question falls within this subject, yet my equipment is slightly older than discussed. I’d like to know if there’s a similar work around concerning changing the date and time of my G4 (OS 9) in order to facilitate the installing process of OS X 10.0.4 which is consistently being interrupted at this time. All personal files have been backed up and the HD has been initialized (Extended).

My system:

• PowerMac G4 (Gigabit Ethernet)
• PowerPC, G4 @400 MHz
• 832 MB RAM
• OS 9.2.1 (& OS X.10.0.4 capable)

First, I could not find the original Apple Install Disks!

For about 2 weeks I’ve tried to install OS X Cheetah to no avail by downloading disk images – different formats: .bin, .iso, .dmg – then burning them onto DVD’s with my iMac Yosemite. Each DVD failed even before the installation process began. Coasters, every one. I’d insert the DVD; the usual window opens revealing the DVD’s contents. After double clicking the Install OS X icon however, the following window opens:

An error occurred.
“System Disk was unable to select the install CD as the Startup Disk. (-1)”

After much groaning and gnashing of teeth, in a bit of luck, I found the original Apple Install Disks!

Installed OS 9 through 9.2.2 immediately without a hitch.

Now, I’m in a new lost-loop-of-time trying to install OS X 10.0.4 from the original Apple Startup Disk.The firmware has been updated, the disk itself has been cleaned, all is in order that I’m aware – except! This what happens when I double click the Install OS X icon:

• The Restart Installation window opens
• I click Restart
• She boots up!
• The screen goes black
• Grey screen loads with a ‘Happy Mac’
• Beachball spins for approximately 3.5 minutes…

Then, I get the following text message of a white font with a black background (grey screen and ‘Happy Mac’ still intact):

“The installer has unexpectedly quit (error 1)
Press the return key to restart computer…”

⁃ kmod_destroy: AppleMac R1SC2PE (id17), deallocating 8 pages starting at 0x1148a000
⁃ kmod_destroy: AppleMediaBay (id23), deallocating 4 pages starting at 0x115b7000
⁃ kmod_destroy: AppleThermal (id49), deallocating 3 pages starting at 0x11404000
⁃ kmod_destroy: IOUSBHIDDRIVER (id15), deallocating 6 pages starting at 0x11b12000
⁃ kmod_destroy: AppleOWScreamerAudio (id54), deallocating 4 pages starting at 0x11428000
⁃ kmod_destroy: AppleBurgundyAudio (id56), deallocating 6 pages starting at 0x11b22000
⁃ kmod_destroy: IOHIDFAMILY (id50), deallocating 6 pages starting at 0x11b09000

** Side note – pressing the Return key restarts the computer. **

Moving forward…

A few days ago I ran across an OSXDaily posted thread made Jan 19, 2015 entitled FIXING OS X INSTALL ERRORS “CAN’T BE VERIFIED” AND “ERROR OCCURRED WHILE PREPARING THE INSTALLATION” ( which discusses changing the date and time of the computer to match the creation date of the Install Program using the Terminal application.

OS 9 has no Terminal app of course, however I did try to change the time and date of my G4 using the proper Control Panel (which did not work). There seems to be two (2) creation dates for OS X Cheetah:

⁃ 9/3/2000 12:28am
⁃ 1/31/2001 3pm

Neither worked.

So finally, my question:
Do You Know a Workaround for Installing OS X 10.0.4 on a Powermac G4 Using the Original Apple Cd which isn’t Allowed to Function Properly?

Many Thanks!

So helpful! Thanks! It solved this “This copy of the install OS is damaged…” Perfect!!! So many hours trying before reaching your page finally 😀

I was trying to install OSX Yosemite on an older mac for a friend but got this message over and over… even after changing it to the correct date 4/12/18. Then I changed the year to 2014 and then it worked. It needed to have the date range for Yosemite not the current date. So frustrating… thanks for the tips

Can someone help me how to get the Yosemite installer? I tried going to the App Store and it wasn’t available on my Purchased page.

if you can please help with another suggestion or command, I would certainly appreciate it. I’m really trying to get this macbook updated as much as possible, for the programs I need to get my work done. The programs I already have wont work on maverick and just sorta sitting there waiting for me to use. Thanks.

date 1020170014
no spaces… in your example it is not obvious not to use no spaces. Id suggest giving an actual example in futre.

Holy shit. I just entered the date and it was the same value as in the example. Was meant to be.

This also solved the problem I was having while trying to install Yosemite onto an old MacBook Pro from a USB stick. Thank you!

Thank you so much. The tip with the date helped a lot. The only thing to add is you need to enter the date and time as per UTC time

Leave a Reply

Your email address will not be published. Required fields are marked *