From owner-freebsd-questions Tue May 15 21: 0:44 2001 Delivered-To: freebsd-questions@freebsd.org Received: from itouch.co.nz (itouch.co.nz [203.99.66.188]) by hub.freebsd.org (Postfix) with ESMTP id B202B37B423 for ; Tue, 15 May 2001 21:00:37 -0700 (PDT) (envelope-from jonc@itouch.co.nz) Received: (from jonc@localhost) by itouch.co.nz (8.11.3/8.11.1) id f4G40Sl24373; Wed, 16 May 2001 16:00:28 +1200 (NZST) (envelope-from jonc) Date: Wed, 16 May 2001 16:00:28 +1200 From: Jonathan Chen To: Crist Clark Cc: freebsd-questions@FreeBSD.ORG Subject: Re: mktime(3) Bug? Message-ID: <20010516160028.A23996@itouchnz.itouch> References: <3B01CD18.6E725786@globalstar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3B01CD18.6E725786@globalstar.com>; from crist.clark@globalstar.com on Tue, May 15, 2001 at 05:43:04PM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, May 15, 2001 at 05:43:04PM -0700, Crist Clark wrote: [...] > At first I thought it might be a conversion-only problem, but you get > the same thing if you _set_ the time across a DST boundary. Looking at > the date(1) code and reviewing the manpages, my best guess is that > mktime(3) uses the _current_ DST settings when setting the "target" > time. > > That would explain the behavior. And that, IMHO, is a bug. When a > user types that second command, he expects to see midnight on the > 1st, not 11 PM on the 31st. The DST of the "target" time should be > used by mktime(3), not the current one. This is especially true if > the user were setting the time rather than just displaying it. > > This is a bug, right? Yes. I'd agree with you there. The current situation would lead to the possibility of displaying non-existing times (ie those in the changeover periods). Cheers. -- Jonathan Chen ---------------------------------------------------------------------- Opportunities are seldom labeled To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message