Was going to hard reset a MacBook Air from 2010, the issue could probably happen on all Mac though. This is what was done:
So by holding down the alt-key (option-key) and the powerbutton while the mac is shut down you’ll get into a recovery state for both resetting and using time travel. In this case I erased the main hdd and selected reinstall OS X. By continuing it says this: “To download and restore os x your computer’s eligibility will be verified with apple”.
This gave the following error: “An error occurred while preparing the installation. try running this application again”
The issue was the date. Apparently if the date is obscured Apple will not approve. Open up the terminal, it can be accessed from from the Utility menu on top while in the recovery mode.
Type in “date”, this will print out the date and time, if this isn’t correct, hurray! You can fix this.
To change the date and time, type in “date 201410081224”. The command parameters depends on your date format for you machine. So the order might be different for you. But something close to “”date” year month date hour min”. If you’re still total lost type “man date” and take a look at the examples further down the manual page.
Thank to “Rcd_” from forum: https://discussions.apple.com/message/25282853 for the date solution.
If the date thing wasn’t your issues take a look at the following which might case your error:
Try Computers that can be upgraded to use OS X Internet Recovery: http://support.apple.com/kb/HT4904
OS X: About OS X Recovery: http://support.apple.com/kb/HT4718