Меню Рубрики

Windows cmd time set

time time

Отображает или задает системное время. Displays or sets the system time. Если используется без параметров, то время отображает текущее системное время и предлагает ввести новое время. If used without parameters, time displays the current system time and prompts you to enter a new time.

Чтобы изменить текущее время, необходимо быть администратором. You must be an administrator to change the current time.

Синтаксис Syntax

Параметры Parameters

Параметр Parameter Описание Description
[: [: [. ]]] [am | pm] Устанавливает системное время на новое указанное время, где чч — в часах (обязательно), mm — в минутах, а SS — в секундах. Sets the system time to the new time specified, where HH is in hours (required), MM is in minutes, and SS is in seconds. Nn может использоваться для указания сотых долей секунды. NN can be used to specify hundredths of a second. Необходимо разделять значения чч, mmи SS с помощью двоеточий (:). You must separate values for HH, MM, and SS with colons (:). SS и nn должны быть разделены точкой (.). SS and NN must be separated with a period (.).

Если параметр AM или PM не указан, по умолчанию используется 24 -часовой формат . If am or pm isn’t specified, time uses the 24-hour format by default. /t /t Отображает текущее время без запроса на новое время. Displays the current time without prompting you for a new time. /? /? Отображение справки в командной строке. Displays help at the command prompt.

Комментарии Remarks

Допустимые значения чч : от 0 до 24. Valid HH values are 0 through 24.

Допустимые значения mm и SS : от 0 до 59. Valid MM and SS values are 0 through 59.

Примеры Examples

Если расширения команд включены, для вывода текущего системного времени введите: If command extensions are enabled, to display the current system time, type:

Чтобы изменить текущее системное время на 5:30 PM, введите один из следующих элементов: To change the current system time to 5:30 PM, type either of the following:

Чтобы отобразить текущее системное время, а затем ввести новое время, введите следующую команду: To display the current system time, followed by a prompt to enter a new time, type:

Для сохранения текущего времени и возврата в командную строку нажмите клавишу ВВОД. To keep the current time and return to the command prompt, press ENTER. Чтобы изменить текущее время, введите новое время и нажмите клавишу ВВОД. To change the current time, type the new time and then press ENTER.

Источник

Команда NET TIME вывод текущего времени сервера

NET TIME синхронизирует показания часов компьютера с другим компьютером или доменом. Если используется без параметров в домене Windows Server, выводит текущую дату и время дня, установленные на компьютере, который назначен сервером времени для данного домена. Эта команда позволяет задать сервер времени NTP для компьютера.

Синтаксис команды NET TIME

  1. net time [<\\имя_компьютера | /domain[:имя_домена] | /rtsdomain[:имя_домена]>] [/set]
  2. net time [\\имя_компьютера] [/querysntp]
  3. net time [\\имя_компьютера] [/setsntp[:список_серверов_NTP]], где
  • \\имя_компьютера — указывает имя сервера, время на котором нужно проверить или с которым нужно синхронизировать таймер.
  • /domain[:имя_домена] — задает имя домена, с которым синхронизируются часы.
  • /rtsdomain[:имя_домена] — указывает домен сервера надежного времени (RTS), с которым будут синхронизироваться часы.
  • /set — синхронизирует часы с временем указанного компьютера или домена.
  • /querysntp — выводит имя сервера NTP (Network Time Protocol), сконфигурированного для локального компьютера, или компьютера, указанного в параметре \\имя_компьютера.
  • /setsntp[:список_серверов_NTP] — указывает список серверов времени NTP для использования на локальном компьютере.

Примеры команды NET TIME

  • net help time — отображение справки для указанной команды net;
  • net time \\PC1— вывод на экран текущего времение сервера в сети для компьютера PC1;
  • net time /querysntp — отображение на экране имени сервера NTP для локальнго компьютера;
  • net time \\Proton /set — синхронизация часов локального компьютера с временем компьютера Proton.

Net time системная ошибка 5 отказано в доступе

Часто спрашивают, почему появляется «Системная ошибка 5. Отказано в доступе» при использовании команды Net time. Отвечаю, все в правах пользователя под которым запускается команда. В качестве примера пробовал запустить команду сначала с правами локального администратора на Windows 10 — получил ошибку, далее запустил с правами администратора домена — результат на рисунке ниже.

Видео — NET TIME ознакомление с командой

Источник

Set time zone from command line (CMD)

Time zone setting allows us to set the time according to the geographical location the computer is located at. We can change the time zone of a computer in Date and Time properties window which can be opened by running timedate.cpl from Run window.

Few readers of the blog have put this question to me. Is it possible to set the time zone from command line?

The answer varies depending on which Windows edition you have. In Windows 7, we have a command called tzutil using which we can easily change time zone from windows command line. In Windows XP, it’s bit complicated.

Windows 7

You can run the below command to set timezone in Windows 7.

Command to set time zone to Pacific Standard Time:

Command to set time zone to Central America standard time:

Get the current time zone

We can find the current time zone by running the following command.

Get the list of time zones

Run the command ‘tzutil /l‘ to get the list of time zones available.

Windows XP/Server 2003

While searching for a solution to this problem I got to know that there is a Windows Resource kit tool called timezone.exe which can be used to change day light savings..It does not set time zone. I tried further to find if there is any registry hack and below is what I came up with.

I found that the below registry key stores the information about different time zones.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.

There is another registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation which has information about the current time zone. This registry has the following information on my computer.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
Bias REG_DWORD 0x1e0
StandardName REG_SZ Pacific Standard Time
StandardBias REG_DWORD 0x0
StandardStart REG_BINARY 00000B00010002000000000000000000
DaylightName REG_SZ Pacific Daylight Time
DaylightBias REG_DWORD 0xffffffc4
DaylightStart REG_BINARY 00000300020002000000000000000000
ActiveTimeBias REG_DWORD 0x1e0

Now it’s clear that in order to change the time zone we need to put right data in these registry values.

Now the question is how to get these values for the time zone you want to set? It’s very simple. You just need to set the time to your desired time zone using GUI (timedate.cpl) and then capture the registry values by exporting the registry key TimeZoneInformation to a reg file. Whenever you want to set the time zone from command line just run the exported .reg file and then reboot the machine to make the changes effective. You can run the .reg command from a batch file also.

The above method works for all Windows versions – XP, Windows 7, Server 2003 and Server 2008.

There’s another method in circulation for setting time zone from command prompt.

When I had tested the command on XP, I found that it does not work for all the timezones. In Windows 7, it does not work at all. It just opens the time and date configuration window.

CONTROL.EXE TIMEDATE.CPL,,/Z W. Europe Standard Time
y tests showed that this does not work if you use the names that are shown in the XP timezone dialog. It seems that those are only display names.
When I used the names for the subkey of
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones
it worked well. Those names are all English and it seems that XP needs that.

Your solution of changing time zone works very nicely. But to reflect changes made in registry we have to restart the machine. Is there anyway to immediately reflect updated timezone change setting without reboot ?

I could not find any way of changing timezone from cmd without causing a reboot.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Windows cmd text replace
  • Windows cmd star wars
  • Windows cmd show network
  • Windows cmd remove directory
  • Windows cmd random number