Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Apr 2004 11:48:11 -0400
From:      "JJB" <Barbish3@adelphia.net>
To:        "Erik Trulsson" <ertr1013@student.uu.se>
Cc:        "freebsd-questions@FreeBSD. ORG" <freebsd-questions@FreeBSD.ORG>
Subject:   RE: timezone command
Message-ID:  <MIEPLLIBMLEEABPDBIEGGEBBFMAA.Barbish3@adelphia.net>
In-Reply-To: <20040416050053.GA52342@falcon.midgard.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.


--
<Insert your favourite quote here.>
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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?MIEPLLIBMLEEABPDBIEGGEBBFMAA.Barbish3>