From owner-freebsd-stable@FreeBSD.ORG Sun Oct 28 18:36:51 2007 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E7F616A419 for ; Sun, 28 Oct 2007 18:36:51 +0000 (UTC) (envelope-from eugen@www.svzserv.kemerovo.su) Received: from www.svzserv.kemerovo.su (www.svzserv.kemerovo.su [213.184.65.80]) by mx1.freebsd.org (Postfix) with ESMTP id AB32813C4A5 for ; Sun, 28 Oct 2007 18:36:50 +0000 (UTC) (envelope-from eugen@www.svzserv.kemerovo.su) Received: from www.svzserv.kemerovo.su (eugen@localhost [127.0.0.1]) by www.svzserv.kemerovo.su (8.13.8/8.13.8) with ESMTP id l9SIZ8ie025710; Mon, 29 Oct 2007 01:35:08 +0700 (KRAT) (envelope-from eugen@www.svzserv.kemerovo.su) Received: (from eugen@localhost) by www.svzserv.kemerovo.su (8.13.8/8.13.8/Submit) id l9SIZ8A0025709; Mon, 29 Oct 2007 01:35:08 +0700 (KRAT) (envelope-from eugen) Date: Mon, 29 Oct 2007 01:35:08 +0700 From: Eugene Grosbein To: Holger Kipp Message-ID: <20071028183508.GA25172@svzserv.kemerovo.su> References: <20071028174832.GA21847@svzserv.kemerovo.su> <20071028182011.GA89664@intserv.int1.b.intern> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071028182011.GA89664@intserv.int1.b.intern> User-Agent: Mutt/1.4.2.3i Cc: stable@freebsd.org Subject: Re: date manupulation strangeness X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2007 18:36:51 -0000 On Sun, Oct 28, 2007 at 07:20:11PM +0100, Holger Kipp wrote: > > # unixtime=1193511599 > > # LC_ALL=C TZ=Asia/Krasnoyarsk date -jr $unixtime > > Sun Oct 28 02:59:59 KRAT 2007 Here it shows 'Sun Oct 28 02:59:59 KRAST 2007' really (cut-n-paste error, mea culpa). Take a note of zone name, KRAST stands for 'KRAsnoyarsk Summer Time' and KRAT stands for 'KRAsnoyarsk Time' (winter one). > > That's last second of Summer time in this time zone. > > > > # LC_ALL=C TZ=Asia/Krasnoyarsk date -f %s $unixtime > > Sun Oct 28 02:59:59 KRAT 2007 > > > > That's an hour later after the switch from Summer time, > > but how can it be? It is a bug? > > I haven't checked, but usually during switch from summer > to winter time, you change the clock back from 03:00 to > 02:00, so you have the same hour twice. > > So you have 02:59:59 summer time and then you have > (instead of 03:00:00) 02:00:00 winter time a second > later, so one hour later you end up with 02:59:59 again. Yes, but "02:59:59 KRAT" is one hour (minus one second) later than "02:00:00 KRAT", the latter equals to "03:00:00 KRAST", so the first invocation of 'date' command shows time an hour before time the second invocation shows. However, unixtime is the same. That bothers me, something is wrong. Eugene