timezone command

JJB Barbish3 at adelphia.net
Fri Apr 16 08:48:13 PDT 2004

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.

$timezone=date +%z;
cat $timezone

-----Original Message-----
From: owner-freebsd-questions at freebsd.org
[mailto:owner-freebsd-questions at freebsd.org]On Behalf Of Erik
Sent: Friday, April 16, 2004 1:01 AM
Cc: Greg 'groggy' Lehey; freebsd-questions at 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.

<Insert your favourite quote here.>
Erik Trulsson
ertr1013 at student.uu.se
freebsd-questions at freebsd.org mailing list
To unsubscribe, send any mail to
"freebsd-questions-unsubscribe at freebsd.org"

More information about the freebsd-questions mailing list