On Jan 18, 2008 6:47 AM, Yue Chen <[EMAIL PROTECTED]> wrote:
> Greetings, perl fans
>
> I am about to translate a bash script into perl. In bash script, it
> uses "date +%Z" command to get current timezone on local host.
> However, I don't want to redirect this output into a variable,  since
> the perl script will even going to be run on windows. Is there a
> module to get such info?
snip

Get it from the same source that the date command gets it from: the
POSIX function strftime.

#!/usr/bin/perl

use strict;
use warnings;
use POSIX;

print strftime("%Z", localtime()), "\n";

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to