From owner-freebsd-questions@FreeBSD.ORG Sun Sep 30 07:48:56 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABD216A41B for ; Sun, 30 Sep 2007 07:48:56 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.bluestop.org (muon.bluestop.org [80.68.94.188]) by mx1.freebsd.org (Postfix) with ESMTP id 9B60C13C46E for ; Sun, 30 Sep 2007 07:48:56 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.draftnet (cran1.demon.co.uk [80.177.26.208]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTP id E0CA9301F6; Sun, 30 Sep 2007 08:48:54 +0100 (BST) Message-ID: <46FF54E5.4020502@cran.org.uk> Date: Sun, 30 Sep 2007 08:48:53 +0100 From: Bruce Cran User-Agent: Thunderbird 2.0.0.6 (X11/20070809) MIME-Version: 1.0 To: "Brian A. Seklecki" References: <5e433b6210a52ae0220ae0a20d0353e1@prodigy.net> <1191124332.5997.21.camel@new-host> In-Reply-To: <1191124332.5997.21.camel@new-host> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: jekillen , FreeBSD Mailing List Subject: Re: using the date command X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Sep 2007 07:48:57 -0000 Brian A. Seklecki wrote: > To set time: > > $ sudo /usr/sbin/ntpdate pool.ntp.org > 29 Sep 23:48:31 ntpdate[9404]: adjust time server 66.250.45.2 offset > 0.001289 sec > ntpdate is deprecated, you should use "ntpd -q" instead if you want ntpd to set the time once then exit. From ntpdate(8): Note: The functionality of this program is now available in the ntpd(8) program. See the -q command line option in the ntpd(8) page. After a suitable period of mourning, the ntpdate utility is to be retired from this distribution. Also, ntpd wil refuse to update the time if the delta is more than 1000s by default, but you can use the -g option to override this. To set the date to within a reasonable delta, use something like "date 200709282027". If you want to set the time more accurately using NTP, edit /etc/ntp.conf and add "server pool.ntp.org" to it. Save it then run "ntpd -q". If you need to configure the time zone, an easy way to do this is to run sysinstall and select "Configuration --> Time Zone". > To date info about your timezone settings: > > $ zdump /etc/localtime > /etc/localtime Sat Sep 29 23:49:19 2007 EDT > > Options: > > $ ls /usr/shaoneinfo/ | egrep -v "^d" > total 78 > -rw-r--r-- 1 root wheel 755 Aug 22 11:11 CET > -rw-r--r-- 1 root wheel 837 Aug 22 11:11 CST6CDT > -rw-r--r-- 1 root wheel 679 Aug 22 11:11 EET > -rw-r--r-- 1 root wheel 56 Aug 22 11:11 EST > -rw-r--r-- 1 root wheel 837 Aug 22 11:11 EST5EDT > [...] > > To set timezone: > > $ ln -s /share/zoneinfo/$WHATEVER /etc/localtime > > For you probably PST8PDT. > > For your best NTP experience, use OpenNTP from > ports: /usr/ports/net/openntpd/ > > ~BAS > > > > On Sat, 2007-09-29 at 20:33 -0700, jekillen wrote: > >> Hello all; >> I have built 4 machines and installed FreeBSD 6.0 in one and 6.2 >> in the other three. They are all using the wrong date and time. >> The last one (v6.2 on ecs mb with AMD64) is the worst. It is telling >> me today is Jan 3 2003 PST (I am on the west coast and it is still PDT). >> These machines are all web servers. So up until now this has not been >> a big issue but a configuration of software is complaining that the >> files >> it creates have an older date than the files in the software bundle, >> it is time to do something about it. So I am looking at man date and as >> I interpret the instructions #date ccyymmddHHMM.ss (20079282027.00 or >> 200709282027.00 for instance) is supposed to set the >> clock to the current date. But when I run a command with the >> current date and time in the above format I get the complaint that >> the format string is wrong. >> Can anyone be kind enough to give me a quick tutorial on this? >> I will be looking seriously into using NTP, but for now I need to >> get the date straight. I have entries in apache error log gener >> ated by php scripts that are supposed to use its date command. >> Thanks in advance for assistance. >> Jeff K >>