From owner-freebsd-questions@FreeBSD.ORG Thu Apr 15 21:29:00 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8FFD616A4CE; Thu, 15 Apr 2004 21:29:00 -0700 (PDT) Received: from mta10.adelphia.net (mta10.adelphia.net [68.168.78.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16C6443D60; Thu, 15 Apr 2004 21:29:00 -0700 (PDT) (envelope-from Barbish3@adelphia.net) Received: from barbish ([67.20.101.71]) by mta10.adelphia.net (InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with SMTP id <20040416042859.PMKH8065.mta10.adelphia.net@barbish>; Fri, 16 Apr 2004 00:28:59 -0400 From: "JJB" To: "Greg 'groggy' Lehey" Date: Fri, 16 Apr 2004 00:28:58 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal In-Reply-To: <20040416035802.GM24048@wantadilla.lemis.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: "freebsd-questions@FreeBSD. ORG" Subject: RE: timezone command X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Barbish3@adelphia.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 04:29:00 -0000 I know how to set timezone, date and time. I am looking for command to display on the console screen the systems timezone in this kind of format "-00:00" Is there such an command or some way to get this info? In an perl script I tried $timezone= $ENV{TZ} and I did not get 00:00 format which I was looking for. -----Original Message----- From: Greg 'groggy' Lehey [mailto:grog@FreeBSD.org] Sent: Thursday, April 15, 2004 11:58 PM To: JJB Cc: freebsd-questions@FreeBSD. ORG Subject: Re: timezone command On Thursday, 15 April 2004 at 22:15:06 -0400, JJB wrote: > Time zone has been set during sysinstall. > Is there an console command to display my configured time zone like > format +05:00? Not quite like that (are you in Pakistan?). The problem is that time zones aren't that simple: they contain information about daylight savings time, as well as implicit historical information that gets lost when you reduce it to a number. Admittedly, Pakistan doesn't seem to have DST, but that's the way it is. In general, the system time zone is stored in the file /etc/localtime. You can set it with: # cp /usr/share/zoneinfo/Asia/Karachi /etc/localtime # date Fri Apr 16 08:55:27 PKT 2004 If you remove it, it defaults to "GMT" (really UTC): # rm /etc/localtime # date Fri Apr 16 03:55:37 GMT 2004 Even then, you can specify the time zone explicitly with the TZ environment variable: # TZ=Asia/Karachi date Fri Apr 16 08:55:45 PKT 2004 Greg -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply or reply to the original recipients. For more information, see http://www.lemis.com/questions.html Note: I discard all HTML mail unseen. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers.