Skip site navigation (1)Skip section navigation (2)
Date:      19 Aug 2002 12:37:56 -0600
From:      John-David Childs <nospamposter@nterprise.net>
To:        Patrick Thomas <root@utility.clubscholarship.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how to determine the time zone a system has ?
Message-ID:  <1029782279.3077.87.camel@lohr.digitalglobe.com>
In-Reply-To: <20020818162244.C58763-100000@utility.clubscholarship.com>
References:  <20020818162244.C58763-100000@utility.clubscholarship.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2002-08-18 at 17:23, Patrick Thomas wrote:
> 
> No, I'm saying, what if it is not my system and I dont want to touch
> anything, and I want to tell, just by lookig at /etc/localtime what TZ the
> system is currently in 

Uh, the date command will tell you the default TIMEZONE, *unless* you
have an environment variable (TZ) overriding it:

taliacyn:/localhost/home/jchilds>date
Mon Aug 19 18:36:34 GMT 2002

taliacyn:/localhost/home/jchilds>setenv TZ America/Denver
taliacyn:/localhost/home/jchilds>date
Mon Aug 19 12:37:26 MDT 2002



... i thought that by comparing /etc/localtime with
> the zone files you could tell - and I have done that before, I just lost
> the slick line of shell code that md5'd localtime and compares it to all
> timezones and output the file it matched...
> 
> On Mon, 19 Aug 2002, Jonathan Chen wrote:
> 
> > On Sun, Aug 18, 2002 at 07:17:04AM -0700, Patrick Thomas wrote:
> > >
> > > Hello,
> > >
> > > I loosely understand that the correct mechanism to determine the time zone
> > > that a freebsd system has is to md5 a certain file and then compare that
> > > md5 with the time zone files themselves and then look at the name of the
> > > file that matches....i think...
> >
> > Um. No. You run tzsetup(8). That helps you choose among the files in
> > /usr/share/zoneinfo, and copies it to /etc/localtime.
> > --
> > Jonathan Chen <jonc@chen.org.nz>
> > ----------------------------------------------------------------------
> >   If you're right 90% of the time, why quibble about the remaining 3%?
> >
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message





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?1029782279.3077.87.camel>