- Changing system date from Terminal – OS X recovery
- Related
- Adding a grid view to the WordPress admin users section
- Tibber – the Electric power company for the future
- Tesla Model S in the winter
- Установите системное время в Mac OS X из командной строки 2021
- Mac OS X Welcome Videos
- Установите системную дату в Mac OS X из командной строки с центральным сервером времени
- Установите системную дату Mac вручную с помощью команды терминала
- Установите системное время в Mac OS X из командной строки
- Установите Системную дату в Mac OS X из командной строки с помощью Центрального сервера времени
- Установка даты системы Mac вручную командой терминала
- Set the System Time in Mac OS X from the Command Line
- Set System Date in Mac OS X from Command Line with a Central Time Server
- Set the Mac System Date Manually by Terminal Command
- HOW TO: Change system date in OS X from Terminal
- Change System Date From Terminal
- Conclusion
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:
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:
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 and get 1500km / 1000mi of free supercharging! Get free supercharging
Related
Adding a grid view to the WordPress admin users section
Recently the WP-admin has gotten more attention from core developers. The Media section recently got a grid design, and the plugins area also got a visual improvement. A thought that followed; why not do the same for the User section? This idea first came around for me while working on…
Tibber – the Electric power company for the future
Electric power companies, in general, are pretty much the same. Tibber however, is unlike any electricity company I had seen before. They try to utilise the data we get from smart devices, which they also sell, to save electricity, money and the environment, as well as improving comfort. It’s a…
Tesla Model S in the winter
This is hands down the question I’m asked most often, «How does the Tesla Model S handle the norwegian winters?» The short answer is great! Naturally opinions will vary, but for me it has been awesome. It has made me leave my petrol car out in the cold, literally. Preheated Lets…
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…
Источник
Установите системное время в Mac OS X из командной строки 2021
Mac OS X Welcome Videos
Часы в Mac OS X устанавливаются автоматически по умолчанию, но если вы хотите установить точное время или ищете решение для командной строки, чтобы установить системное время, вы можете сделать это с помощью инструмента ntpdate или стандартной даты. команда.
Установите системную дату в Mac OS X из командной строки с центральным сервером времени
Для ntpdate, который устанавливает дату и время на основе времени с центрального сервера, доступ к которому осуществляется через Интернет, вы можете указать его либо на серверах времени Apple, либо на pool.ntp.org, чтобы получить точное время:
sudo ntpdate -u time.apple.com
При появлении запроса введите пароль администратора, и вскоре вы увидите что-то вроде следующего:
4 Jul 14:30:11 ntpdate: adjust time server 17.151.16.14 offset 0.000336 sec
Смещение в конце позволяет узнать, насколько отличались системные часы от вновь установленного времени. В этом примере системные часы были отключены на смехотворно малую долю секунды.
Как правило, вам не нужно делать это, если вы используете функцию «Установить дату и время автоматически» в системных настройках «Дата и время», хотя, устанавливая часы в командной строке, вы можете быть уверены, что на каждом компьютере в сети отображается точное в то же время.
Установите системную дату Mac вручную с помощью команды терминала
Другой подход состоит в том, чтобы установить дату вручную из командной строки, используя командную строку «date», где date в формате ЧЧ] MM, то есть месяц Date Hour Minute Year без разделения. Это выглядит примерно так:
Для этого примера будет установлена дата «12 июля 2018 года в 12:23».
Вы можете узнать больше об установке даты с помощью даты –help, которая также указывает, что вы можете даже установить секунды, если хотите.
Трюк с датой — это то, что вы хотели бы использовать, если у рассматриваемого Mac нет доступа в Интернет по той или иной причине.
Источник
Установите системное время в Mac OS X из командной строки
Часы в Mac OS X автоматически устанавливаются по умолчанию, но если вы хотите установить точное время или ищете решение командной строки для установки системного времени, вы можете сделать это с помощью инструмента ntpdate или стандартной «даты», команда.
Установите Системную дату в Mac OS X из командной строки с помощью Центрального сервера времени
Для ntpdate, который устанавливает дату и время на основе времени с центрального сервера, доступного через Интернет, вы должны указать его либо на серверах времени Apple, либо в pool.ntp.org следующим образом, чтобы получить точное время:
sudo ntpdate -u time.apple.com
Введите пароль администратора, когда его спросят, и вы скоро увидите что-то вроде следующего:
4 июл 14:30:11 ntpdate [28267]: настроить сервер времени 17.151.16.14 offset 0.000336 sec
Смещение в конце позволяет вам узнать, как расходятся системные часы с вновь установленным временем. В этом примере системные часы были выключены смехотворно малой долей секунды.
Обычно вам не нужно это делать, если вы используете функцию «Установить дату и время автоматически» в настройках системы даты и времени, хотя, установив часы через командную строку, вы можете быть уверены, что каждая машина в сети показывает точный в то же время.
Установка даты системы Mac вручную командой терминала
Другой подход — установить дату вручную из командной строки, используя командную строку «date», где дата находится в формате [mm] [dd] HH] MM [yy], который является месяцем Date Hour Minute Year без какого-либо разделения , Это выглядит примерно так:
В этом примере он установил бы дату «12 июля 2018 года в 12:23».
Вы можете узнать больше об установке даты с датой -help, которая также указывает, что вы даже можете установить секунды, если хотите.
Титк «даты» — это то, что вы хотели бы использовать, если у Mac, о котором идет речь, нет доступа к Интернету по той или иной причине.
Источник
Set the System Time in Mac OS X from the Command Line
The clock in Mac OS X sets itself automatically by default, but if you want to set the precise time or are looking for a command line solution to set system time, you can do so with a tool called ntpdate, or the standard ‘date’ command.
Set System Date in Mac OS X from Command Line with a Central Time Server
For ntpdate, which sets the date and time based on the time from a central server accessed via the internet, you’d want to point it either at Apple’s time servers or pool.ntp.org as follows to get the exact time:
sudo ntpdate -u time.apple.com
Enter the admin password when asked, and you’ll soon see something like the following:
4 Jul 14:30:11 ntpdate[28267]: adjust time server 17.151.16.14 offset 0.000336 sec
The offset at the end lets you know how divergent the system clock was with the newly set time. In this example, the system clock was off by a laughably small fraction of a second.
You generally don’t need to do this if you use the “Set date and time automatically” feature within the Date & Time system preferences, though by setting clocks through the command line you could be sure that each machine on a network shows the exact same time.
Set the Mac System Date Manually by Terminal Command
Another approach is to set the date manually from the command line by using the “date” command string, where date is in the [mm][dd]HH]MM[yy] format, which is Month Date Hour Minute Year without any separation. This looks something like:
For that example, it would set the date as “July 12 2018 at 12:23”.
You can learn more about setting the date with date –help, which also specifies that you can even set the seconds if you want to.
The ‘date’ trick is what you’d want to use if the Mac in question does not have internet access for one reason or another.
Источник
HOW TO: Change system date in OS X from Terminal
If you’ve left your Mac lying around for a very long time or if you bought a used one, the system date may be out of whack. Often the system date on neglected Macs gets reset to the year 2001, which prevents you from reinstalling OS X, but you can get this done through Terminal.
UPDATE: This article is dated and may not be relevant to your version of macOS. Please use with caution and understand that whatever you do to your Mac is on you. We hold no responsibility for any damage following this guide may cause.
More often than not, you’ll get an error that reads, “An error occurred while preparing the installation. Try running again.” At this point, many people will throw in the towel and figure the computer is toast. But that’s usually not the case. A terminal window looks similar to this.
Change System Date From Terminal
Here are some simple steps to change the OS X system date from Terminal when doing a fresh install.
- Insert a USB key with OS X install into Mac (or install disc)
- Power up and hold the Option key down as soon as you hear the startup chime.
- Choose OS X to install
- Once booted into recovery, choose Utilities from the menu and then Terminal.
- Type date into Terminal and hit enter; this displays the date; if it is not the current date, you need to go to the next step.
- Type date into Terminal followed by today’s date in this format [month][day][hour][minute][year] so today is July 11, 2016, 2:15 that would be date 0711141516 then press enter. Of course, your date and time will vary.
- Rerun the first command in Terminal date and press enter; the date should now be fixed.
At this point, you should now be able to continue your reinstall of OS X on your Mac, and the installation error should no longer appear. For whatever reason, the system date matters when installing the OS on your Mac. So if you get that error, don’t panic and think your Mac is toast, try this fix first, and you should be golden.
Conclusion
This is a fairly easy fix, and it works wonders if you’ve purchased a Mac off of eBay or from Craigslist. Sometimes these Macs end up sitting around for a while, and the system date gets out of whack. Now you don’t have to worry about it being a brick and can bring it back to life.
Did you use this method to fix your system date? Let us know in the comments below or on Twitter, or on Facebook. You can also comment on our MeWe page by joining the MeWe social network.
Источник