develooper Front page | perl.perl5.porters | Postings from July 2001

[ID 20010704.001] POSIX strftime always print date/time in GMT

Thread Next
From:
olav
Date:
July 4, 2001 02:29
Subject:
[ID 20010704.001] POSIX strftime always print date/time in GMT
Message ID:
200107040926.LAA06274@melvin.jordforsk.no
This is a bug report for perl from olav@melvin.jordforsk.no,
generated with the help of perlbug 1.33 running under perl v5.6.1.


-----------------------------------------------------------------
[Please enter your report here]
In earlier versions (5.6.0), I always had to set the environment variable
TZ to "GMT" to print (strftime) the real time from my data in a database (stored as seconds
since 1 jan 1970), but now I get GMT time via strftime although the 
TZ is set to MET. The follwing script gives date wrong by two hours:

#!/usr/local/bin/perl

$ENV{TZ} = "MET";

use POSIX;

tzset();
@tz = tzname();
print "@tz\n";

$dato = strftime("%Y/%m/%d %T",gmtime(time()));
print "$dato\n";


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.6.1:

Configured by olav at Tue Jun 12 12:35:18 MEST 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos melvin 5.8 generic_108528-04 sun4u sparc sunw,ultra-5_10 '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.3 20010315 (release)', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.6.1:
    /usr/local/lib/perl5/5.6.1/sun4-solaris
    /usr/local/lib/perl5/5.6.1
    /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.6.1
    /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.6.1:
    HOME=/local/olav
    LANG=C
    LANGUAGE (unset)
    LC_CTYPE=no
    LC_MONETARY=no
    LC_TIME=no
    LD_LIBRARY_PATH=/usr/local/lib:/usr/openwin/lib:/usr/dt/lib:/opt/gnome/lib:/opt/lib:/usr/local/pgplot:/usr/local/pgsql/lib:/usr/local/ssl/lib:/usr/local/adabas/lib:/usr/local/qt/lib:/usr/local/kde/lib:/opt/SUNWns6
    LOGDIR (unset)
    PATH=./:/usr/local/enlightenment/bin:/jmov/src:/usr/openwin/bin:/opt/SUNWns6:/usr/local/teTeX/bin:/usr/local/teTeX/bin/sparc-sun-solaris2.8:/usr/local/bin:/opt/gnome/bin:/opt/bin:/usr/sbin:/usr/bin:/bin:~/bin:~/src:/usr/hosts:/usr/ccs/bin:/usr/ucb:/usr/UAP/cmds:/usr/UAP/bin:/usr/informix/bin:/usr/etc:/usr/local/unixstat:/usr/local/pbm:~/hosts:/usr/local/pgsql/bin:/usr/local/p3d:/opt/SUNWwabi/bin:/usr/local/sybase/bin:/usr/local/jre1.1.8/bin:/usr/local/R/bin:/usr/local/pbmplus:/usr/local/soffice/bin:/usr/local/canna/bin:/usr/local/BerkeleyDB/bin:/usr/local/samba/bin:/usr/local/tnt:/usr/local/Amaya/solaris2/bin:/usr/local/qt/bin:/usr/local/noweb:/usr/local/ssl/bin:/usr/dt/bin:/usr/local/kde/bin:/usr/local/adabas/bin:/usr/local/adabas/pgm:/usr/local/rtf2latex2e
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About