From owner-freebsd-questions@FreeBSD.ORG Fri Apr 16 08:48:13 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 2507516A4CE for ; Fri, 16 Apr 2004 08:48:13 -0700 (PDT) Received: from mta9.adelphia.net (mta9.adelphia.net [68.168.78.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCBDF43D5D for ; Fri, 16 Apr 2004 08:48:12 -0700 (PDT) (envelope-from Barbish3@adelphia.net) Received: from barbish ([67.20.101.71]) by mta9.adelphia.net (InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with SMTP id <20040416154812.LBKR26615.mta9.adelphia.net@barbish>; Fri, 16 Apr 2004 11:48:12 -0400 From: "JJB" To: "Erik Trulsson" Date: Fri, 16 Apr 2004 11:48:11 -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) In-Reply-To: <20040416050053.GA52342@falcon.midgard.homeip.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal 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 15:48:13 -0000 Yes that is close enough for an starting point, thank you. I need $timezone to hold the time zone in this format -00:00 The command date +%z will give it as -0000 I know nothing about writing perl scripts. Can somebody show me how to add the : in the output of the date command in the simple following script? The cat statement is just so I can see results are correct. #!/usr/bin/perl $timezone=date +%z; cat $timezone -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Erik Trulsson Sent: Friday, April 16, 2004 1:01 AM To: JJB Cc: Greg 'groggy' Lehey; freebsd-questions@FreeBSD. ORG Subject: Re: timezone command On Fri, Apr 16, 2004 at 12:28:58AM -0400, JJB wrote: > 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. Try 'date +%z' to get the timezone in the format "+0200". Not exactly what you asked for, but almost. -- Erik Trulsson ertr1013@student.uu.se _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"