Date: Thu, 18 Mar 1999 10:57:48 -0500 (EST) From: Kelly Yancey <kbyanc@alcnet.com> To: Jonathan Chen <jonc@pinnacle.co.nz> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: proper way to set TZ? Message-ID: <Pine.BSF.4.05.9903181050330.53892-100000@kronos.alcnet.com> In-Reply-To: <Pine.SC5.4.10.9903180902360.26476-100000@kiwi.pinnacle.co.nz>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 18 Mar 1999, Jonathan Chen wrote: > On Wed, 17 Mar 1999, Kelly Yancey wrote: > > > > > I have a couple of scripts which rely on TZ being set to the server's > > time zone. What is the proper was to do this so I don't have to put a > > TZ=EST; export TZ before invoking any of the scripts. > > Is there a startup script that this should be in? If so, which one? > > TZ is a SysV mechanism. What are you trying to do, exactly? If you > really want to get it, I suppose one way of doing it is to get the > output of: > > date '+%Z' > Hmm. The problem is that the scripts are currently written in perl (which doesn't actually have a built-in interface to ctime, although I suppose if I get desparate I could make a ph file from the c header). I have already written some code which splits all the information out of gmtime or localtime in perl but it can't get the timezone. It would seem that my solutions are limited to: Just invoking the date command and stripping the trailing newline (downside: fork overhead just to get the time) Living without the timezone (downside: I really need the timezone recorded in logs) Where exactly does the ctime() get it's timezone information? Where is it recorded...I can set it with tzset but I can't get the information back out. I really appreciate the help! Kelly > -- > Jonathan Chen | "Vini, vidi, velcro... > | I came, I saw, I stuck around" > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9903181050330.53892-100000>