1 .\" $OpenBSD: src/usr.sbin/rdate/rdate.8,v 1.29 2004/07/09 19:33:08 jmc Exp $
2 .\" $NetBSD: rdate.8,v 1.4 1996/04/08 20:55:17 jtc Exp $
3 .\" $DragonFly: src/usr.sbin/rdate/rdate.8,v 1.3 2008/02/01 21:40:53 swildner Exp $
5 .\" Copyright (c) 1994 Christos Zoulas
6 .\" All rights reserved.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\" must display the following acknowledgement:
18 .\" This product includes software developed by Christos Zoulas.
19 .\" 4. The name of the author may not be used to endorse or promote products
20 .\" derived from this software without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 .Nd set the system's date from a remote host
45 displays and sets the local date and time from the
46 host name or address given as the argument.
47 The time source may be an RFC 868 TCP protocol server,
48 which is usually implemented as a built-in service of
50 or an RFC 2030 protocol SNTP/NTP server.
53 uses the RFC 868 TCP protocol.
55 The options are as follows:
60 to use IPv4 addresses only.
64 to use IPv6 addresses only.
68 call to gradually skew the local time to the
69 remote time rather than just hopping.
72 Sometimes required when synchronizing to an NTP server.
73 When synchronizing using the RFC 868 protocol, use this option only if the
74 server does not correctly account for leap seconds.
75 You can determine if you need this parameter if you sync against an NTP
76 server (with this parameter) or (recommended) check with a local radio
77 controlled watch or phone service.
79 Use SNTP (RFC 2030) instead of the RFC 868 time protocol.
81 Do not set, just print the remote time.
83 Do not print the time.
86 Always show the adjustment.
89 .Bl -tag -width /var/log/wtmp -compact
91 record of date resets and time changes
94 To get the legal time in Germany, set the
97 .Pa /usr/share/zoneinfo/right/Europe/Berlin
98 and issue the following command:
100 .D1 Li "# rdate -ncv ptbtime1.ptb.de"
102 The command of course assumes you have a working internet connection
103 and DNS set up to connect to the server at
104 .Sy Physikalisch-Technische Bundesanstalt
105 in Braunschweig, Germany.
107 To gradually adjust time once an hour after the first
109 adjustment, put the following line into root's crontab:
111 .D1 Li "58 * * * * rdate -ncav ptbtime1.ptb.de | logger -t NTP"
116 .Xr ntpd 8 Pq Pa pkgsrc/net/openntpd ,