How to synchronize time on a computer with a server. How to synchronize time on a computer with the Internet. How to set the date and time on Android The time on the computer does not sync with the Internet

Maybe someone will come in handy.

What should I do if the exact time is not set on the computer (automatically or at all)? And what is it all about?

Right-click on the clock in the taskbar and select item from the menu Date-time setting(computer user must have Administrator rights). The settings window will open on the tab date and time. Here the date and time can be set manually; if the deviation from reality is large (more than a few minutes), it is better to do this, even if you intend to do an automatic adjustment, since if the initial deviation is large, the automatic procedure will not work (don't forget to check and set the date too!)

Go to bookmark Timezone and check if your belt is correct.

Go to bookmark internet time. Check if it is missing Perform Internet Time Synchronization, then click on the button Update now. After a few seconds or a couple of minutes, a message will appear in the window indicating the success or failure of the synchronization.

If the synchronization was successful, this means that your computer, now automatically, will set the exact time - once a week. If this suits you, then you can not read further; if synchronization does not work or you are not satisfied with the weekly interval - read on.

What could be the reasons for the lack of synchronization and what to do about it?

1. In the box (drop-down list) Server to the left of the button Update now Invalid/invalid time server specified. Most often, this is the time.windows.com server. Expand the list and select another server (usually the list consists of two items and the second is time.nist.gov). Press the button again.

2. Check if you are connected to the Internet. It is necessary that the firewall and router pass UPP packets on port 123 (ie NTP protocol). The usual settings for the Windows firewall and "household" routers are just that; if the Internet provider or the system administrator of the organization in which the computer is located filter traffic - ask "to open UDP port 123".

3. It may turn out that all servers from the list are inoperative. Unfortunately, the list of servers cannot be edited by simple means, but read below how to do it.

How to edit the list of servers, connection order and check interval?

Attention - The procedure for editing the Windows registry is described below. Do not change other registry settings other than those described, registry damage can lead to Windows inoperability!

1. Open the registry editor: button Start, Further Run, type regedit and press the key Input.

2. In the left part of the window, in the registry settings tree, select

3. In the right part of the window, click on the parameter name (number 1 or 2 in the left column) and edit the address of the exact time server - set a valid address instead of a broken one (the addresses are easy to find out through Google - the query is "precise time server" or "ntp server") .

3. If necessary, edit the parameter (default), which specifies the server number (1 or 2) used by default (this setting can also be changed without the Registry Editor, as described above).

4. Now go to the section

5. Here we may be interested in the parameter SpecialPollInterval. It contains the interval between attempts to check the exact time, in seconds. By default, this is a week (consider for yourself - a breakthrough of seconds). If this interval does not suit you (for example, the clock is not very accurate and runs away in a week, or the computer is often disconnected from the Internet, and the week can stretch for many weeks), the parameter can be edited. Click on its name in the left column.

Flip the switch Number system into position Decimal(unless, of course, you need it) and enter the desired number in the field Meaning, click OK. Do not set values ​​less than half an hour (1800).

6. Close the registry editor window.

For information about the exact time, and to synchronize manually, use the services of one of the so-called Daytime servers. Before connecting to such a server, make sure you have a Telnet console client (found on both Linux and many versions of Windows). Run the telnet program with a parameter consisting of the server's IP address and port number, separated by a colon. The port number for the Daytime protocol is always 13. For example: telnet 198.60.73.8:13
In response, you will receive information about the time and date, after which the connection will be automatically disconnected. Ignore the clock - the server is in a different time zone. You only need information about minutes and seconds. Use only those servers from the list that are explicitly said to support the Daytime protocol. Never connect to the same server more than once every four seconds inclusive, otherwise your IP address will be (your requests will be taken as DoS-).

To automatically clock the computer with the server, you will have to use another protocol - NTP. It is supported by all servers from the specified list, even those that use the Daytime protocol. However, it is best to use a more accurate NTP server for this - ntp.mobatime.com. The public server pool time.windows.com is somewhat less accurate. Please note that the URLs of these servers are written without the usual "http://www" string. In no case should requests to any NTP servers be repeated more than once every four seconds, inclusive.

To automatically synchronize the computer's built-in clock with an NTP server on a Linux operating system, first install the ntp package. Then enter the command: sudo ntpdate (NTP server URL)

In order for the Windows operating system to automatically synchronize the time with an NTP server each time the computer is turned on, select the "Date and Time" item in the "Control Panel". Switch to the Time tab. Check the "Enable synchronization with an Internet time server" checkbox. Enter the URL of the NTP server in the only field on the page.

Install the Server Time J2ME application on your mobile phone. After running it, enter the URL of the NTP server in the settings. Then select "Start!" from the menu. After the request is made, you can compare the time on the server with the time in the phone's built-in clock. You will have to synchronize manually, despite the use of the NTP protocol. This is because the Java Virtual Machine on the phone does not allow applications to change the system clock.

How to set up time synchronization in the entire domain at once? And so that it works on its own? And when the domain controller with the PDC role changes, what should I do? And if time synchronization in the domain is already configured, but it doesn’t work well, how to fix it?
Read about all this in this article.

A bit of theory

Time synchronization in a domain can (theoretically) work by itself, without any settings. It usually looks like this:

  1. Domain computers and servers synchronize their time with the domain controllers (with those closest to them).
  2. Domain controllers synchronize their time with a domain controller that is assigned the FSMO PDC role (in windows 2000 terms, "primary domain controller").
  3. A domain controller (DC) with the PDC role synchronizes time with an external source.
  • If the domain controller is virtual, time synchronization [with the host] must be turned off in the virtual machine settings. Otherwise (if, for example, the host with virtual machines is in a domain): the virtual domain controller will (automatically) synchronize time with the host, and the host with the nearest domain controller, i.e. with your virtual machine.
  • If time synchronization is already configured (manually or through group policies), then the new settings you specify may not be applied (despite the successful message in all commands) and then a complete reset of time synchronization settings on problem computers or domain controllers will be required.

How to check if time synchronization is working in a domain?

Before “breaking” anything (and during the configuration process, in order to check the effectiveness of the changes being made), it is necessary to diagnose the current state, as well as analyze the current configuration of the time service. Several commands below are designed to help with this.

Team
w32tm /monitor

  1. Can be executed on any computer (or domain controller).
  2. Shows a list of all domain controllers (with which time synchronization can be performed).
  3. For each domain controller, the "NTP:" field displays the time difference with the domain controller's PDC (which is the source for domain-wide time synchronization).
  4. For each domain controller, the "RefID:" field displays information about the time synchronization source for that domain controller. For all domain controllers (except for a CD with the PDC role), this must be either another domain controller or a CD with the PDC role.

Team
w32tm /query /Source
or
w32tm /query /peers

  1. Shows the source for time synchronization (with which computer the time of the computer on which this command is run is synchronized). For any computers/servers it should be one of the domain controllers, for any domain controller (except PDC) it should be another CD (usually with the PDC role), for a CD with the PDC role it should be an external time synchronization source (Internet).
    If the command results show the message "VM IC Time Synchronization Provider", then this virtual machine is being synchronized with the virtualization host. If this virtual machine is one of the domain controllers, this setting should be changed!

Team
w32tm /query /Configuration /verbose

  1. Can be run on any computer or domain controller.
  2. Displays all windows time service settings for the current computer.
  3. Verify that in the results of running the command on all computers and domain controllers (except PDCs), the Type field in the section is set to NT5DS. If this is not the case, the synchronization settings on such computers must be corrected (how - see below).
  4. If you have Windows 2003, then you cannot run this command. Instead, you can look at the time service configuration settings in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters, in particular the Type parameter.

Team
w32tm /query /status /verbose

  1. Can be run on any computer or domain controller.
  2. Displays the sync status (including sync source, time, and last sync status) for the computer it's running on. The "/verbose" option gives more detailed information.

Team
w32tm /stripchart /computer:" "/samples:3/dataonly

Compares the time (and displays the time difference) on the current computer with the computer specified in the /computer argument. The source computer for time comparison can be either on the Internet or in the local domain. Command examples:
w32tm /stripchart /computer:"ntp.org" /samples:3 /dataonly
or
w32tm /stripchart /computer:"dc1.domain.local" /samples:3 /dataonly

How to fix time synchronization settings

Setting up time synchronization on computers and domain controllers
(except CD with PDC role)

  1. Find any group policies that change time synchronization settings and disable such policies. Through group policies, the time service is configured here: gpedit.msc => "Computer Configuration" => "Administrative Templates" => "System" => "Windows Time Service" => "Time Providers". Check that the time synchronization policies are not applied, to do this, you can run the command:
    gpresult /R
  2. Verify that time synchronization with virtualization hosts is disabled on all virtual machines - domain controllers. To do this (in Hyper-V), you can go to the properties of the virtual machine, the integration tools section and turn off time synchronization. After that, the configuration of the time service (on the virtual domain controller) needs to be updated.
  3. Update the configuration on all problem computers / domain controllers (except for the CD with the PDC role):
    w32tm /config /syncfromflags:DOMHIER /update
  4. Force time synchronization by issuing the command to rediscover the time synchronization sources:
    w32tm /resync /rediscover
  5. If the above steps do not help, restart the time service (on problem computers)
    net stop w32time
    net start w32time
    and repeat steps 3 and 4.
  6. If the above steps did not solve the problem with time synchronization, you need to re-register the time service on the problem computers (and reconfigure the settings).
    net stop w32time
    w32tm /unregister
    w32tm /register
    net start w32time

The time settings on the CD with the PDC role are fundamentally different from the settings on all other computers in the domain (including other domain controllers). The PDC is the source of time for the entire domain, and it is its time that will be used (directly or indirectly through other domain controllers) by all other computers.

  1. If the domain controller with the PDC role is a virtual machine, make sure that time synchronization with the host on which it is located is disabled in the settings of this virtual machine!
  2. Make sure that the domain-wide time synchronization group policies (if you have them) do not apply to the CD with the PDC role! This computer has a time source - on the Internet, and the type of time synchronization (unlike the rest of the domain) is not NT5DS, but NTP!
  3. If there is any doubt that the time synchronization on the CD with the PDC role is working correctly, the easiest thing to do is to re-register and re-configure the time service.

Re-registering the time service on a domain controller with the PDC role

To unregister and re-register the time service, run the following commands:

net stop w32time
w32tm /unregister
w32tm /register
net start w32time

Configuring time synchronization on a domain controller with the PDC role

Our CD with the PDC role must be configured to synchronize with an external source (on the Internet). The NT5DS synchronization type and synchronization according to the domain hierarchy (DOMHIER) are not suitable for this purpose. Therefore, on our CD with the PDC role, we use the NTP synchronization type and the synchronization will be configured manually (MANUAL). Synchronization sources (peers) are specified in quotes, and if there are several such sources, they are listed separated by commas. In addition, we instruct to consider this synchronization source (CD with the PDC role) as a reliable time source (reliable):

w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org" /reliable:yes /update

It's no secret that even electronics cannot achieve absolute accuracy. This is evidenced at least by the fact that after a certain period the computer's system clock, which is displayed in the lower right corner of the screen, may differ from real time. To prevent such a situation, it is possible to synchronize the exact time with an Internet server. Let's see how this is implemented in practice in Windows 7.

The main condition under which you can synchronize the clock is the presence of an Internet connection on the computer. There are two ways to synchronize the clock: using standard Windows tools and using third-party software.

Method 1: Time synchronization using third-party programs

Let's figure out how to synchronize time over the Internet using third-party programs. First of all, you need to select the software to install. One of the best programs in this direction is SP TimeSync. It allows you to synchronize the time on your PC with any atomic clock available on the Internet via the NTP time protocol. Let's figure out how to install it and how to work in it.

  1. After launching the installation file, which is located in the downloaded archive, a welcome window of the installer opens. Click Next.
  2. In the next window, you need to determine where the application will be installed on the computer. By default, this is the programs folder on the disk. C. It is not recommended to change this setting unless absolutely necessary, so just click Next.
  3. A new window informs you that SP TimeSync will be installed on your computer. Click Next to start the installation.
  4. The SP TimeSync installation process on the PC starts.
  5. Next, a window opens, which says about the end of the installation. Click to close it. Close.
  6. Click the button to launch the application. "Start" in the lower left corner of the screen. Next go by name "All programs".
  7. In the list of installed software that opens, look for the SP TimeSync folder. Click on it for further steps.
  8. The SP TimeSync icon will be displayed. Click on the indicated icon.
  9. This action initiates the launch of the SP TimeSync application window in the "Time". So far, only local time is displayed in the window. To display the server time, click on the button "Get Time".
  10. As you can see, now both local and server time are displayed in the SP TimeSync window at the same time. It also displays metrics such as delta, latency, start, NTP version, accuracy, freshness, and source (in the form of an IP address). To synchronize your computer clock, click "Set time".
  11. After this action, the local time of the PC is brought in accordance with the server time, that is, synchronized with it. All other indicators are reset. To compare local time with server time again, click again. "Get Time".
  12. As you can see, this time the difference is quite small (0.015 sec). This is due to the fact that synchronization was carried out quite recently. But, of course, it is not very convenient to synchronize the time on the computer manually every time. To set up this process automatically, go to the tab "NTP client".
  13. In field "Get Every" you can specify a period of time in numbers, after which the clock will be automatically synchronized. Next, in the drop-down list, it is possible to select the unit of measurement:
    • Seconds;
    • minutes;
    • Clock;
    • Day.

    For example, let's set the interval to 90 seconds.

    In field "NTP Server" if desired, you can specify the address of any other synchronization server, if the one that is set by default ( pool.ntp.org) does not suit you for some reason. In field "Local port" best not to make changes. By default, there is a number «0» . This means that the program connects to any free port. This is the best option. But, of course, if for some reason you want to assign a specific port number to SP TimeSync, you can do so by entering it in this field.

  14. In addition, the same tab contains the accuracy control settings that are available in the Pro version:
    • Try time;
    • Number of successful attempts;
    • Retry limit.

    But, since we are describing the free version of SP TimeSync, we will not dwell on these features. And to further configure the program, move to the tab "Parameters".

  15. Here, first of all, we are interested in the point "Run at Windows startup". If you want SP TimeSync to start automatically when the computer starts, and not to do it manually every time, then check the box next to the specified item. In addition, you can check the boxes next to the items "Minimize tray icon" and "Run with minimized window". By setting these settings, you will not even notice that the SP TimeSync program is running, since it will carry out all actions to synchronize time at a set interval in the background. The window will need to be called only if you decide to make adjustments to the previously set settings.

    In addition, for users of the Pro version, the ability to use the IPv6 protocol is available. To do this, you just need to check the box next to the corresponding item.

    In field "Language" if desired, you can choose from a list of 24 available languages. By default, the system language is set, that is, in our case, Russian. But English, Belarusian, Ukrainian, German, Spanish, French and many other languages ​​are available.

Thus, we have configured the SP TimeSync program. Now every 90 seconds, the Windows 7 time will be automatically updated according to the server time, and all this is done in the background.

Method 2: Synchronization in the "Date and Time" window

In order to synchronize time using the built-in capabilities of Windows, you need to perform the following algorithm of actions.

  1. Click on the system clock located in the bottom corner of the screen. In the window that opens, navigate to the inscription "Change date and time settings".
  2. After starting the window, go to the section "Internet Time".
  3. If this window indicates that the computer is not configured for automatic synchronization, then in this case click on the inscription "Change settings...".
  4. The settings window starts. Check the box next to "Synchronize with an Internet time server".
  5. After performing this action, the field "Server", which was previously inactive, becomes active. Click on it if you wish to select a server other than the default one ( time.windows.com), although this is not required. Choose the appropriate option.
  6. After that, you can perform an immediate synchronization with the server by clicking "Update Now".
  7. After completing all the settings, click OK.
  8. In the window "Date and time" press too OK.
  9. Now your time on the computer will be synchronized with the time of the selected server once a week. But, if you want to set a different automatic synchronization period, then it will not be as easy to do as in the previous method using third-party software. The fact is that the user interface of Windows 7 simply does not provide for changing this setting. Therefore, you will have to make adjustments to the system registry.

    This is a very responsible business. Therefore, before proceeding to the procedure, think carefully about whether you need to change the automatic synchronization interval, and whether you are ready to cope with this task. Although there is nothing unusually complicated here. You just need to approach the matter responsibly, in order to avoid fatal consequences.

    If you still decide to make changes, then call the window "Run" by dialing the combination Win+R. In the field of this window, enter the command:

    Click OK.

  10. The window of the editor of the Windows 7 system registry opens. In its left part there are registry keys, presented as directories placed in a tree form. Go to section "HKEY_LOCAL_MACHINE" by double-clicking on its name with the left mouse button.
  11. Next, in the same way, go sequentially to the subsections "SYSTEM", "CurrentControlSet" and Services.
  12. A very large list of subsections opens. Look for a name in it W32Time. Click on it. Go to subsections Time Providers and "NTPClient".
  13. On the right side of the Registry Editor, subsection parameters are presented. "NTPClient". Double click on the option "SpecialPollInterval".
  14. The parameter change window is launched "SpecialPollInterval".
  15. By default, the values ​​in it are set in hexadecimal. The computer works well with this system, but it is incomprehensible to the average user. Therefore, in the block "calculus system" move the switch to position "Decimal". After that in the field "Meaning" number will be displayed 604800 in the decimal system of measurement. This number displays the number of seconds after which the PC clock is synchronized with the server. It is easy to calculate that 604800 seconds equals 7 days or 1 week.
  16. In field "Meaning" parameter change window "SpecialPollInterval" enter the time in seconds after which we want to synchronize the computer clock with the server. Of course, it is desirable that this interval be less than the one set by default, and not more. But it is up to each user to decide for himself. As an example, we will set the value 86400 . Thus, the synchronization procedure will be performed once a day. Click OK.
  17. Now you can close the Registry Editor window. Click the standard close icon in the top right corner of the window.

Thus, we set up automatic synchronization of the local PC clock with the server time once a day.

Method 3: command line

The next way to start time synchronization involves using the command line. The main condition is that before starting the procedure you are logged in with an account name with administrator rights.


You can synchronize time in Windows 7 either using third-party software or using the internal capabilities of the operating system. Moreover, this can be done in various ways. Each user simply has to choose the most suitable option for himself. Although objectively using third-party software is more convenient than using built-in OS tools, it should be taken into account that installing third-party programs creates an additional load on the system (albeit a small one), and can also be a source of vulnerabilities for malefactors.

Date: 2013-05-31

This article will talk about Time Synchronization in Windows XP. In Windows XP, it is possible to set the period time synchronization systems with Internet time via NTP (Network Time Protocol). In addition, I will add that not only Windows XP has this ability, but also all operating systems from the Windows family that came out later.

It is possible to change the synchronization period through the Windows XP registry in the branch

HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/W32Time/TimeProviders/NTPClient

The SpecialPollInterval parameter is responsible for the value of the synchronization period. By default, this parameter is set to 3600 decimal. This parameter is specified in seconds.

Suppose there is a need to set the synchronization period to 1 day or 24 hours. The arithmetic for calculating the desired value is simple here.

1 minute = 60 seconds 1 hour = 60 minutes Number of seconds in 1 hour = 60 seconds * 60 minutes = 3600 seconds Number of seconds in 24 hours = 3600 seconds * 24 hours = 86400 seconds

Parameter value SpecialPollInterval can be specified in both decimal and hexadecimal. Interval SpecialPollInterval at 24 hours in hexadecimal is 15180. So, set the parameter SpecialPollInterval calculated interval value in 24 hours.

In order not to mess with the registry and edit these values ​​manually every time, it will be easier to do it once and then export this registry branch and edit it manually, leaving only the parameter with the SpecialPollInterval value. As a result, you should get something like this. Or if you automate even more, then you can create and subsequently launch such a .

To check the performance of the above, go to "Start" - "Control Panel". In the menu that opens, you need to switch to the classic view. Select the "Date and Time" menu. A window called "Properties: Date and time" will open. In the upper part we find a tab with the name "Internet Time" and go to it. If the tab elements are not active, then to activate, check the box “Synchronize with an Internet time server”. In the "Server" field, select one of several servers with which time synchronization will be performed.

as servers time synchronization with the default Internet, there are already standard time.windows.com and time.nist.gov servers. Moreover, in the "Server" field, the server is displayed, the last time synchronization with which was successful. This server is remembered by the system automatically.

After clicking on the “Update Now” button, time synchronization should occur and below the message “Time successfully synchronized with SERVER NAME” and even lower “Next synchronization run: TOMORROW DAY.MONTH.YEAR in HOUR.MINUTES” will be displayed.

If the message displays "Error while synchronizing with SERVER NAME", then you should check your Internet connection, the connection may have been lost. If there is an Internet connection, you should try again, and if the result is the same, then in the "Server" field you need to try changing the server to another one and try again.

If during the update the result is again with an error, then most likely the problem is in the antivirus, or rather in its firewall (firewall), which blocks the port through which the PC connects to the NTP server. The standard Windows firewall (Firewall) does not block these ports, unless, of course, it is forced to do so.

So, to make sure that the antivirus blocks or does not block the connection to the NTP server, there are 2 solutions to this dilemma:

1. If you are a pro at setting up your antivirus software, then you can check the antivirus firewall and configure filtering in it.

2. If the anti-virus software settings allow, disable the firewall in it for a while. If for some reason this does not work, then you can try to temporarily suspend the operation of the antivirus itself and check the time synchronization with the Internet. The most important thing after checking is not to forget to turn on what was turned off.

Add new NTP server time synchronization with the Internet is possible through the same Windows registry. Moreover, it is possible to do this even without access to the Internet. Synchronization server values ​​are stored in the section

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/DateTime/Servers

To add a server, you need to create a string parameter in this registry branch (REG_SZ type) with the following serial number and enter the name of the NTP server in the value of the new created parameter.

The review has already been viewed 7627 times!