From owner-freebsd-questions Tue Oct 12 15:42:48 1999 Delivered-To: freebsd-questions@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id 3D0531514B for ; Tue, 12 Oct 1999 15:42:34 -0700 (PDT) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.9.3) id SAA35321; Tue, 12 Oct 1999 18:45:28 -0400 (EDT) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199910122245.SAA35321@cc942873-a.ewndsr1.nj.home.com> Subject: Re: XClock UTC? In-Reply-To: from Don Read at "Oct 12, 1999 02:16:09 pm" To: dread@texas.net (Don Read) Date: Tue, 12 Oct 1999 18:45:28 -0400 (EDT) Cc: sheldonh@uunet.co.za (Sheldon Hearn), freebsd-questions@FreeBSD.ORG, cjclark@home.com Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Don Read wrote, > > On 12-Oct-99 Sheldon Hearn wrote: > > > > > > On Tue, 12 Oct 1999 14:22:59 +0200, Sheldon Hearn wrote: > > > >> No. From the xclock manpage: > > > > Damn, I made a mistake when checking for existing follow-ups to your > > question, otherwise I wouldn't have embarrassed myself like this. > > > > Anyone know when xclock started grokking TZ? > > > > My understanding is libc.[a/so] handled localtime conversions. Since, surprisingly, people do seem to have a non-negligible interest in the question, I'll pass along what I had found. I did have a look at the source code later on yesterday when I had the time. xclock(1) does the following (from XClock.c), (void) time(&time_value); tm = *localtime(&time_value); str = asctime(&tm); And no further processing of the text string is done. As for how TZ gets involved in there, see localtime(3). It seems like it would be only slightly more than trival to change that asctime(3) call into a strftime(3)[0] call and add the needed command line/environmental/Xdefaults to get a format string used. Maybe if I get really bored this week... [0] Love the bug note on strftime(3), "BUGS There is no conversion specification for the phase of the moon." -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message