in reply to (jcwren) Re: Time::CTime::strftime won't print Timezones...
in thread Time::CTime::strftime won't print Timezones...

However...I like to stay away from backticks as much as I can. Any other ideas?
  • Comment on RE: (jcwren) Re: Time::CTime::strftime won't print Timezones...

Replies are listed 'Best First'.
RE: RE: (jcwren) Re: Time::CTime::strftime won't print Timezones...
by chromatic (Archbishop) on Oct 11, 2000 at 07:42 UTC
    The magic %ENV gives you access to environmental variables:
    use POSIX; $ENV{TZ} = 'KTZ'; # Kinakuta Time Zone print strftime('%l:%M:%S %p %Z, %A %B %o, %Y', localtime($time));
    Easy!
      Well...what I want to be able to do is write this script so that it is fairly hands-off as far as configuration. Basically, you put it in your cgi-bin and it runs...properly. I suppose for now that
      $ENV{TZ} = `date +%Z`;
      
      Will suffice.
      Thanks for the advice, guys!