Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$isdst in localtime #6046

Closed
p5pRT opened this issue Oct 30, 2002 · 6 comments
Closed

$isdst in localtime #6046

p5pRT opened this issue Oct 30, 2002 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 30, 2002

Migrated from rt.perl.org#18156 (status was 'resolved')

Searchable as RT18156$

@p5pRT
Copy link
Author

p5pRT commented Oct 30, 2002

From K.McManus@gre.ac.uk

Created by k.mcmanus@gre.ac.uk

Documentation for localtime says...

  "$isdst is true if the specified time occurs during daylight savings
  time, false otherwise."

Unless I am mistaken this is not the case.
I get the same effect on my 5.005_03 built for i386-linux.

HTH

Perl Info


Site configuration information for perl 5.00503:

Configured by ds19 at Mon Feb 14 15:31:53 GMT 2000.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos gandhi 5.5.1 generic_103640-31 sun4u sparc sunw,ultra-1 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc -B/usr/ccs/bin/', optimize='-O3', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc -B/usr/ccs/bin/', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    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 5.00503:
    /pkg/perl-5.005_03/lib/5.00503/sun4-solaris
    /pkg/perl-5.005_03/lib/5.00503
    /pkg/perl-5.005_03/lib/site_perl/5.005/sun4-solaris
    /pkg/perl-5.005_03/lib/site_perl/5.005
    .


Environment for perl 5.00503:
    HOME=/home/mk05
    LANG (unset)
    LANGUAGE (unset)
    LC_COLLATE=en_GB.ISO8859-1
    LC_CTYPE=en_GB.ISO8859-1
    LC_MESSAGES=C
    LC_MONETARY=en_GB.ISO8859-1
    LC_NUMERIC=en_GB.ISO8859-1
    LC_TIME=en_GB.ISO8859-1
    LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/local/gnu/lib:/usr/lib:/usr/local/lib:/usr/local/gnu/lib:/usr/lib:/usr/local/lib:/usr/local/gnu/lib:/usr/openwin/lib
    LOGDIR (unset)
    PATH=/pkg/SUNWspro-4.2/bin:/pkg/tetex/bin/sparc-sun-solaris2.5.1:/home/mk05/bin:/home/mk05/bin/extra:.:/pkg/SUNWspro-4.2/bin:/pkg/tetex/bin/sparc-sun-solaris2.5.1:/home/mk05/bin:/home/mk05/bin/extra:.:/pkg/SUNWspro/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/local/bin:/usr/bin:/usr/ucb:/usr/local/gnu/bin:.:/usr/sbin:/usr/local/bin:/usr/bin/X11:/pkg/captool/bin:/pkg/pvm-3.3.9/pvm3/lib:/pkg/pvm-3.3.9/pvm3/lib/SUNMP:/pkg/pvm-3.3.9/pvm3/bin/SUNMP:/home/lp01/work/psp/captool/bin:/pkg/mpich/bin:/pkg/mpich/lib/solaris/ch_p4:/home/mk05/bin/extra:/usr/local/bin:/usr/bin/X11:/pkg/captool/bin:/pkg/pvm-3.3.9/pvm3/lib:/pkg/pvm-3.3.9/pvm3/lib/SUNMP:/pkg/pvm-3.3.9/pvm3/bin/SUNMP:/home/lp01/work/psp/captool/bin:/pkg/mpich/bin:/pkg/mpich/lib/solaris/ch_p4:/home/mk05/bin/extra
    PERL_BADLANG (unset)
    SHELL=/usr/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Oct 30, 2002

From K.McManus@gre.ac.uk

Bug discovered to be UK (lack of) understanding (US) DST

Apologies for unnecessary posting

k.mcmanus@​gre.ac.uk - http​://staffweb.cms.gre.ac.uk/~k.mcmanus


Dr Kevin McManus ||Queen Mary 413
School of Computing & Math Science ||
The University of Greenwich ||
Park Row, Greenwich ||Tel +44 (0)208 331 8719
London SE10 9LS UK ||Fax +44 (0)208 331 8665

@p5pRT
Copy link
Author

p5pRT commented Oct 30, 2002

From @iabyn

On Wed, Oct 30, 2002 at 04​:27​:02AM -0000, K.McManus@​gre.ac.uk (via RT) wrote​:

Documentation for localtime says...

"$isdst is true if the specified time occurs during daylight savings
time, false otherwise."

Unless I am mistaken this is not the case.
I get the same effect on my 5.005_03 built for i386-linux.

I believe you may be mistaken!

Bear in mind that the result is influenced by the TZ environment variable.
For example, try the following​:

$ cat /tmp/p
#!/usr/bin/perl -w
$t = time;
for (1..10) {
  print +(localtime($t))[8] ? 'dst ' : ' ', scalar(localtime($t)),
  "\n";
  $t -= 86400*365 / 2;
}

$ TZ=GB /tmp/p
  Wed Oct 30 22​:52​:12 2002
dst Wed May 1 11​:52​:12 2002
  Tue Oct 30 22​:52​:12 2001
dst Tue May 1 11​:52​:12 2001
  Mon Oct 30 22​:52​:12 2000
dst Mon May 1 11​:52​:12 2000
  Sun Oct 31 22​:52​:12 1999
dst Sun May 2 11​:52​:12 1999
  Sat Oct 31 22​:52​:12 1998
dst Sat May 2 11​:52​:12 1998

$ TZ=GMT /tmp/p
  Wed Oct 30 22​:52​:20 2002
  Wed May 1 10​:52​:20 2002
  Tue Oct 30 22​:52​:20 2001
  Tue May 1 10​:52​:20 2001
  Mon Oct 30 22​:52​:20 2000
  Mon May 1 10​:52​:20 2000
  Sun Oct 31 22​:52​:20 1999
  Sun May 2 10​:52​:20 1999
  Sat Oct 31 22​:52​:20 1998
  Sat May 2 10​:52​:20 1998

--
That he said that that that that is is is debatable, is debatable.

@p5pRT
Copy link
Author

p5pRT commented Oct 31, 2002

From K.McManus@gre.ac.uk

Hi Dave,

Bear in mind that at this time of year overworked academics make the most
blundering of errors - had i bothered to su root on linux and wind the
clock back I would have realised that... in the UK we speak of saving
daylight in winter but in the US - based on $isdst - i have to assume
that the US save daylight in summer.

Apologies for wasting precious time - weak pun

I take solace in seeing - from google trawl - that i am not the first to
stumble into this localisation error.

Bit pathetic as I write this sat on the Greenwich meridian - the very
origin of time.

Good point - I can confidently report superb bug tracking response from
Perl community to my students.

Regards

k.mcmanus@​gre.ac.uk - http​://staffweb.cms.gre.ac.uk/~k.mcmanus


Dr Kevin McManus ||Queen Mary 413
School of Computing & Math Science ||
The University of Greenwich ||
Park Row, Greenwich ||Tel +44 (0)208 331 8719
London SE10 9LS UK ||Fax +44 (0)208 331 8665

@p5pRT
Copy link
Author

p5pRT commented Feb 25, 2003

From @iabyn

not a bug.

@p5pRT p5pRT closed this as completed Feb 25, 2003
@p5pRT
Copy link
Author

p5pRT commented Feb 25, 2003

@iabyn - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant