Date: Sun, 28 Oct 2007 22:15:38 +0100 From: Holger Kipp <hk@alogis.com> To: Eugene Grosbein <eugen@kuzbass.ru> Cc: stable@freebsd.org Subject: Re: date manupulation strangeness Message-ID: <20071028211538.GA92424@intserv.int1.b.intern> In-Reply-To: <20071028183508.GA25172@svzserv.kemerovo.su> References: <20071028174832.GA21847@svzserv.kemerovo.su> <20071028182011.GA89664@intserv.int1.b.intern> <20071028183508.GA25172@svzserv.kemerovo.su>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 29, 2007 at 01:35:08AM +0700, Eugene Grosbein wrote: > 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). ah, I see. I can reproduce it here as well: %setenv LC_ALL C %setenv TZ Asia/Krasnoyarsk %setenv unixtime 1193511599 %date -jr $unixtime Sun Oct 28 02:59:59 KRAST 2007 %date -jf $s $unixtime Sun Oct 28 02:59:59 KRAT 2007 %date -juf %s $unixtime Sat Oct 27 18:59:59 UTC 2007 %date -jur $unixtime Sat Oct 27 18:59:59 UTC 2007 Interestingly, if output is forced to be in UTC, both give the same results. Using unixtime 1193511600 instead, I get %date -jr $unixtime Sun Oct 28 02:00:00 KRAT 2007 %date -jf %s $unixtime Sun Oct 28 02:00:00 KRAST 2007 With unixtime < 1193509360 both return KRAST and with unixtime > 1193512959 both return KRAT. In between, one returns KRAST, the other KRAT or vice versa... Looks like one of the conversions is getting the summertime-flag wrong here. I have tested this here with 6.2-STABLE from May 20... Regards, Holger
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071028211538.GA92424>