Mac os date command

Установите системное время в Mac OS X из командной строки 2021

Mac OS X Welcome Videos

  • 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 нет доступа в Интернет по той или иной причине.

    Источник

    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:

    Читайте также:  Windows 10 не работает драйвер usb

    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

    Quick Tip: Taking screenshots in OS X

    I snap screenshots quite often, whether the topic is a website that I am working on or anything else graphical that I might need feedback on. Because of this, I know how importent a certain amount of efficiency is. I hope this short guide can help your workflow when working…

    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…

    Quick Tip: Open folders in Sublime Text 2

    In this post I will describe how you can add an item to the context menu in OS X for opening a folder in Sublime Text 2. Secondly we will make it easier to open a file or folder in Sublime from the terminal. Start off by opening Automater, and…

    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…

    Источник

    Question: Q: Cannot set date on Terminal with mmddhhmmyyyy format. Please help ?

    I’m trying hard to set the date on Terminal, as I need to do this for something to work.

    Please help, I have no clue what to do. It’s April 8th 2014, 7:10pm and I’ve typed literally (without spaces):

    04 08 19 10 2014

    08 04 19 10 2014

    04 08 19 10 14

    04 08 07 10 2014

    please help, this is super super urgent, for work, trust me not lying !!

    MacBook Pro, Mac OS X (10.4)

    Posted on Apr 8, 2014 9:14 AM

    All replies

    Loading page content

    Page content loaded

    What is the rest of the command you are using? Is this touch?

    Apr 8, 2014 9:16 AM

    hi, thanks so much for the reply !!

    My bad, fully I type this:

    There must be another syntax they’re looking for.

    I get this message:

    date: bind: Permission denied

    date: settimeofday (timeval): Operation not permitted

    Apr 8, 2014 9:21 AM

    OK did you look at the man page?

    Apr 8, 2014 9:26 AM

    just did. I get this:

    DATE(1) BSD General Commands Manual DATE(1)
    date — display or set date and time
    date [-ju] [-r seconds] [-v [+|-]val[ymwdHMS]] . [+output_fmt]
    date [-jnu] [[[mm]dd]HH]MM[[cc]yy][.ss]
    date [-jnu] -f input_fmt new_date [+output_fmt]
    date [-d dst] [-t minutes_west]
    When invoked without arguments, the date utility displays the current
    date and time. Otherwise, depending on the options specified, date will
    set the date and time or print it in a user-defined way.
    Читайте также:  Как сбросить wsus id windows 10
    The date utility displays the date and time read from the kernel clock.
    When used to set the date and time, both the kernel clock and the hard-
    ware clock are updated.
    Only the superuser may set the date, and if the system securelevel (see
    securelevel(8)) is greater than 1, the time may not be changed by more
    than 1 second.

    Apr 8, 2014 9:24 AM

    Only the superuser may set the date, and if the system securelevel (see

    securelevel(8)) is greater than 1, the time may not be changed by more

    Apr 8, 2014 9:29 AM

    OK, but what can I do then to change the date on Terminal ? Apparently I need to do this to stabilize the date so I can install Mountain Lion (some bug with the time and date apparently..).

    Please tell me what to do .

    Apr 8, 2014 9:29 AM

    Apparently I need to do this to stabilize the date so I can install Mountain Lion (some bug with the time and date apparently..).

    Where did you get this idea? Please explain your situation.

    Apr 8, 2014 9:30 AM

    I’m trying to install Mountain Lion and a ton of ppl have had this same message appear when trying to install it (or Mavericks):

    The bug is actually a problem with stabilizing the date and time, and everything works for the installation just fine afterwards.

    There’s a thread here:

    So all that is keeping me from installing this bad boy is just the freaking date and time bug. PLEASE HELP ME, I’m DESPERATE . 😝

    srsly though. this is work-related important.

    Apr 8, 2014 9:33 AM

    dude, help please !! Tell me what to do ! Is there a way to freeze the time, or manually do something to the date withtout going through Terminal ? Or what other possible syntax, formula can I try on Terminal ??

    Apr 8, 2014 10:01 AM

    You must use superuser privileges to set the date but it is not necessary to enable root.

    sudo date mmddhhnnyyyy

    . but you must substitute the actual date and time in the command that corresponds to the date format used for your location. In other words if your custom is to use a date like 8 February 2014 then reverse the mm and dd values.

    Substitute numerals in the above command according to the following:

    hh = hour (24 hour format)

    nn = minutes past the hour

    Each of those values must be two digits except for the year which can be two or four digits. As an example if the current date and time is February 8, 2014 at 9 PM your command will be the following:

    sudo date 020821002014

    sudo date 0208210014

    Either one will work. If you enter nonsensical values the system will attempt to parse the entry correctly.

    Terminal will ask for your Admin Password — the same one you use when you log in to your Mac. Type it and then press the Return key. What you type will not appear, not even with •••• characters.

    To verify that your change was effective just type the date command and press the Return key. Terminal will reply with the date and time. The value entered does not have to be precise, it just has to be approximate. Selecting the «Set time and date automatically» checkbox and choosing an appropriate time server in System Preferences > Date & Time will adjust your Mac’s system clock to the precise time.

    Читайте также:  Nessus windows 10 установка

    Источник

    Установите системное время в 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 date and time on your Mac

    You can have the date and time set automatically using a network time server, or set your computer’s date and time manually. Be sure your time is correct so time stamps on emails, messages and files are correct.

    On your Mac, choose Apple menu

    > System Preferences, then click Date & Time.

    If the lock at the bottom left is locked , click it to unlock the preference pane.

    Click Date & Time, then set the date and time automatically or manually.

    Automatically: Select “Set date and time automatically”, then choose the network time server for your region.

    Manually: Deselect “Set date and time automatically”, click today’s date on the calendar, drag the clock’s hands to show the correct time (or enter the time), then click Save.

    Click Time Zone, then set the time zone automatically or manually.

    Automatically: Select “Set time zone automatically using current location”.

    Manually: Deselect “Set time zone automatically using current location”, click a location on the map, click the Closest Town/City pop-up menu, then choose the town or city closest to your location.

    To choose the formats used to show dates and times in other languages on your Mac, see Change how dates, times and more display on Mac.

    You can set options to customise how the time and the date appear in the menu bar. See Change Dock & Menu Bar preferences.

    Tip: Click the date and time in the menu bar to open Notification Centre. Use Notification Centre on Mac

    Источник

  • Оцените статью