{
    "mode": "man",
    "parameter": "ntpdate",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/ntpdate/json",
    "generated": "2026-09-13T09:07:33Z",
    "synopsis": "ntpdate [-46bBdqsuv] [-a key] [-k keyfile] [-o version] [-t timeout] server [...]",
    "sections": {
        "NAME": {
            "content": "ntpdate - set the date and time via NTP\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ntpdate [-46bBdqsuv] [-a key] [-k keyfile] [-o version] [-t timeout] server [...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "ntpdate  sets  the  local  date and time by polling the Network Time Protocol (NTP) server(s)\ngiven as the server argument(s) to determine the correct time.  It must be run as root on the\nlocal host (unless the option -q is used).  A number of samples are obtained from each of the\nservers specified and a subset of the NTP clock filter and selection algorithms  are  applied\nto select the best of these. Note that the accuracy and reliability of ntpdate depends on the\nnumber of servers, the number of polls each time it is run and the interval between runs.\n\nntpdate  can  be  run  manually as necessary to set the host clock, or it can be run from the\nhost startup script to set the clock at boot time.  This is useful in some cases to  set  the\nclock  initially before starting the NTP daemon ntpd. It is also possible to run ntpdate from\na cron script. However, it is important to note that ntpdate with contrived cron  scripts  is\nno  substitute  for  the NTP daemon, which uses sophisticated algorithms to maximize accuracy\nand reliability while minimizing resource use. Finally, since ntpdate does not discipline the\nhost clock frequency as does ntpd, the accuracy using ntpdate is limited.\n\nTime adjustments are made by ntpdate in one of two ways. If ntpdate determines the  clock  is\nin  error  more than 0.5 second it will simply step the time by calling the system settimeof‐\nday() routine. If the error is less than 0.5 seconds, it will slew the time  by  calling  the\nsystem  adjtime() routine. The latter technique is less disruptive and more accurate when the\nerror is small, and works quite well when ntpdate is run by cron every hour or two.\n\nntpdate will, if the -u flag was not specified, decline to set the date if an NTP server dae‐\nmon (e.g., ntpd) is running on the same host. When running ntpdate on a  regular  basis  from\ncron  as  an  alternative to running a daemon, doing so once every hour or two will result in\nprecise enough timekeeping to avoid stepping the clock.\n\nNote that in contexts where a host name is expected, a -4 qualifier preceding the  host  name\nforces  DNS  resolution  to the IPv4 namespace, while a -6 qualifier forces DNS resolution to\nthe IPv6 namespace.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-4",
                    "content": "space.\n",
                    "flag": "-4"
                },
                {
                    "name": "-6",
                    "content": "space.\n",
                    "flag": "-6"
                },
                {
                    "name": "-a _",
                    "content": "thentication  as  the  argument keyntpdate. The keys and key identifiers must match in\nboth the client and server key files. The default is  to  disable  the  authentication\nfunction.\n",
                    "flag": "-a"
                },
                {
                    "name": "-B",
                    "content": "fault.\n",
                    "flag": "-B"
                },
                {
                    "name": "-b",
                    "content": "(default) using the adjtime() system call. This option should be used when called from\na startup file at boot time.\n",
                    "flag": "-b"
                },
                {
                    "name": "-d",
                    "content": "just  the  local  clock and using an unprivileged port. Information useful for general\ndebugging will also be printed.\n",
                    "flag": "-d"
                },
                {
                    "name": "-k _",
                    "content": "Specify the path for the authentication key file as the string keyfile. The default is\n/etc/ntpsec/ntp.keys. This file should be in the format described in ntpd.\n",
                    "flag": "-k"
                },
                {
                    "name": "-o _",
                    "content": "Specify the NTP version for outgoing packets as the integer version, which can  be  1,\n2, 3 or 4. The default is 4. This allows ntpdate to be used with older NTP versions.\n",
                    "flag": "-o"
                },
                {
                    "name": "-q",
                    "content": "",
                    "flag": "-q"
                },
                {
                    "name": "-s",
                    "content": "ity. This is designed primarily for convenience of cron scripts.\n",
                    "flag": "-s"
                },
                {
                    "name": "-t _",
                    "content": "Specify the maximum time waiting for a server response as the value timeout,  in  sec‐\nonds and fraction. The value is rounded to a multiple of 0.2 seconds. The default is 1\nsecond, a value suitable for polling across a LAN.\n",
                    "flag": "-t"
                },
                {
                    "name": "-u",
                    "content": "when behind a firewall that blocks incoming traffic to privileged ports, and you  want\nto synchronise with hosts beyond the firewall. Note that the -d option always uses un‐\nprivileged ports.\n",
                    "flag": "-u"
                },
                {
                    "name": "-v",
                    "content": "logged.\n",
                    "flag": "-v"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "ntpdate's exit status is zero if it found a server and updates the clock, and nonzero  other‐\nwise.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/ntp.keys\n- encryption keys used by ntpdate.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "David L. Mills (mills@udel.edu)\nThis man page was converted from HTML to roff by Fabrizio Polacco <fpolacco@debian.org>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ntpdate-debian(8)\n\nntpdate(8)",
            "subsections": []
        }
    },
    "summary": "ntpdate - set the date and time via NTP",
    "flags": [
        {
            "flag": "-4",
            "long": null,
            "arg": null,
            "description": "space."
        },
        {
            "flag": "-6",
            "long": null,
            "arg": null,
            "description": "space."
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "thentication as the argument keyntpdate. The keys and key identifiers must match in both the client and server key files. The default is to disable the authentication function."
        },
        {
            "flag": "-B",
            "long": null,
            "arg": null,
            "description": "fault."
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "(default) using the adjtime() system call. This option should be used when called from a startup file at boot time."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "just the local clock and using an unprivileged port. Information useful for general debugging will also be printed."
        },
        {
            "flag": "-k",
            "long": null,
            "arg": null,
            "description": "Specify the path for the authentication key file as the string keyfile. The default is /etc/ntpsec/ntp.keys. This file should be in the format described in ntpd."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "Specify the NTP version for outgoing packets as the integer version, which can be 1, 2, 3 or 4. The default is 4. This allows ntpdate to be used with older NTP versions."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "ity. This is designed primarily for convenience of cron scripts."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "Specify the maximum time waiting for a server response as the value timeout, in sec‐ onds and fraction. The value is rounded to a multiple of 0.2 seconds. The default is 1 second, a value suitable for polling across a LAN."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond the firewall. Note that the -d option always uses un‐ privileged ports."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "logged."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "ntpdate-debian",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ntpdate-debian/8/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Synchronize and set the date and time via NTP.",
        "examples": [
            {
                "description": "Synchronize and set date and time",
                "command": "sudo ntpdate {{host}}"
            },
            {
                "description": "Query the host without setting the time",
                "command": "ntpdate -q {{host}}"
            },
            {
                "description": "Use an unprivileged port in case a firewall is blocking privileged ports",
                "command": "sudo ntpdate -u {{host}}"
            },
            {
                "description": "Force time to be stepped using `settimeofday` instead of `slewed`",
                "command": "sudo ntpdate -b {{host}}"
            }
        ]
    }
}