No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Hong Shen
Hong Shen Add an arg to treat too-early date in HTTP response as error.
Some buggy routers changes 'Date:' header based on their own timers.
When a device is connected to such a router, and we reboot them at the same time,
htpdate on that device MAY receive a 1970-year date before the router getting an
NTP response, and cannot change to correct date later due to the huge offset.
Latest commit b707e2f Jan 20, 2014



The HTTP Time Protocol (HTP) is used to synchronize a computer's time
with web servers as reference time source. Htpdate will synchronize your
computer's time by extracting timestamps from HTTP headers found
in web server responses. Htpdate can be used as a daemon, to keep your
computer synchronized.
The accuracy of htpdate is at least -+0.5 seconds (better with multiple
servers). If this is not good enough for you, try the ntpd package.

Install the htpdate package if you need tools for keeping your system's
time synchronized via the HTP protocol. Htpdate works also through
proxy servers.

Installation from source

Tested on Linux and FreeBSD only, but should work for most Unix flavors.

	$ tar zxvf htpdate-x.y.z.tar.gz
	$ tar jxvf htpdate-x.y.z.tar.bz2
	$ cd htpdate-X.Y.Z
	$ make
	$ make install

An example init script (scripts/htpdate.init) for use in /etc/init.d/
is included, but not installed automatically. This scripts with run
htpdate as a daemon.

Another option is to use htpdate in a cronjob and start it periodically
from cron. For a daily time sync it would look something like this:
5 3 * * * /usr/bin/htpdate -s

Installation from RPM

The easiest way to install (Redhat, SuSE, Mandriva etc..)

	$ rpm -Uvh htpdate-x.y.z.i386.rpm

By default the htpdate daemon is activated (with chkconfig).
If you only want to run htpdate from cron, disable the htpdate service
with 'chkconfig --del htpdate'.


Usage: htpdate [-046abdhlqstxD] [-i pid file] [-m minpoll] [-M maxpoll]
	[-p precision] [-P <proxyserver>[:port]] [-u user[:group]]
	<host[:port]> ...

	E.g. htpdate -q

In general, if more web servers are specified, the accuracy will increase.

See manpage for more details.

To do

- I'm open for suggestions :)