SPUG: Portable way to get local time zone

Darren/Torin/Who Ever... torin at daft.com
Tue Mar 20 00:28:22 CST 2001


Richard Anderson, in an immanent manifestation of deity, wrote:
>What is a portable way to get the local timezone from within a mod_perl
>module?  I see that on Linux 2.2.16 I can do "ls -l /etc/localtime" and on
>Solaris 2.7 I can do "tail -1 /etc/TIMEZONE", but I want something that is
>portable.
>
>The $TZ variable does not seem to be set in my mod_perl program's
>environment ...

You can look at the difference between localtime() and gmtime().  I did
this at first.

But then I needed to do more and found out that there is a
Time::Timezone modules on CPAN...

Darren
-- 
<torin at daft.com><http://www.daft.com/~torin/> <torin at debian.org><perl at slut.org>
Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-206-ELF-LIPZ
@		     Make a little hot-tub in your soul.		      @

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list