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

Erroneous date (Y2K) displayed by pod2man #1088

Closed
p5pRT opened this issue Jan 26, 2000 · 3 comments
Closed

Erroneous date (Y2K) displayed by pod2man #1088

p5pRT opened this issue Jan 26, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 26, 2000

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

Searchable as RT2041$

@p5pRT
Copy link
Author

p5pRT commented Jan 26, 2000

From qdtmibt@al.edt.ericsson.se

When generating a man-page from a recently edited perl module
I noticed that the date read '26/Jan/100'.

Looking into pod2man I found the following function (linenumbers
have been prepended)​:

296 sub makedate {
297 my $secs = shift;
298 my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($secs);
299 my $mname = (qw{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec})[$mon];
300 return "$mday/$mname/$year";
301 }

Looking into the perlfunc manpage it says that 'localtime' returns
the number of years since 1900, i.e. 100 for this year.

Either you should add 1900 to $year or maybe take $year modulo 100.

Perl Info


Site configuration information for perl 5.00502:

Configured by edthavz at Tue Feb  2 17:29:58 MET 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos edt004 5.6 generic_105181-08 sun4u sparc sunw,ultra-1 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='/EDUP/Gcc/2.8.1/bin/gcc', optimize='-O', gccversion=2.8.1
    cppflags=''
    ccflags =''
    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='/EDUP/Gcc/2.8.1/bin/gcc', ldflags =''
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G'

Locally applied patches:
    


@INC for perl 5.00502:
    /home/gps/Devenv/lib/perl5
    /home/gps/Devenv/lib/perl5/site_perl/sun4-solaris
    /home/gps/Devenv/lib/perl5/site_perl
    /home/gps/Devenv/lib/perl5/site_perl/5.005/sun4-solaris
    /home/gps/Devenv/lib/perl5/site_perl/5.005
    /home/gps/Src/AdminTool/Delivery/external/admintool/lib/perl5/site_perl/5.005/sun4-solaris
    /home/gps/Src/AdminTool/Delivery/external/admintool/lib/perl5/site_perl/5.005
    /home/gps/Src/ERmark/Delivery/external/ermark/lib/perl5/site_perl/5.005/sun4-solaris
    /home/gps/Src/ERmark/Delivery/external/ermark/lib/perl5/site_perl/5.005
    /EDUP/Perl/5.005/lib/perl5/5.00502/sun4-solaris
    /EDUP/Perl/5.005/lib/perl5/5.00502
    /EDUP/Perl/5.005/lib/perl5/site_perl/5.005/sun4-solaris
    y
    .


Environment for perl 5.00502:
    HOME=/home/qdtmibt
    LANG=en_US
    LC_COLLATE=en_US
    LC_CTYPE=en_US
    LC_MESSAGES=C
    LC_MONETARY=en_US
    LC_NUMERIC=en_US
    LC_TIME=en_US
    LD_LIBRARY_PATH=/home/qdtmibt/Devenv/lib:/home/qdtmibt/Devenv/lib:/EDUP/Apssystem/3.0/lib/runtime:/usr/dt/lib:/usr/openwin/lib:/usr/lib:/usr/ucblib:/usr/4lib
    LOGDIR (unset)
    PATH=/EDUP/Perl/5.005/bin:/usr/ccs/lib:/EDUP/SUNWspro/bin:/home/ias/ias/dist/IAS_R13C_SunOS5/bin:/opt/pub/bin:/home/qdtmibt/Devenv/bin:/EDUP/Emacs/20.2/bin:/EDUP/Apssystem/3.0/bin:/EDUP/Netscape/4.06:/EDUP/Frame/5.1/bin:/usr/dt/bin:/EDUP/Site/bin:/EDUP/Util/1.3/bin:/usr/openwin/bin:/bin:/usr/bin:/usr/ucb:.:/usr/ucb:/usr/ccs/bin:/usr/ucb:/usr/ccs/bin
    PERL5LIB=/home/gps/Devenv/lib/perl5:/home/gps/Devenv/lib/perl5/site_perl:/home/gps/Devenv/lib/perl5/site_perl/5.005:/home/gps/Src/AdminTool/Delivery/external/admintool/lib/perl5/site_perl/5.005:/home/gps/Src/ERmark/Delivery/external/ermark/lib/perl5/site_perl/5.005
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Jan 26, 2000

From [Unknown Contact. See original ticket]

Either you should add 1900 to $year or maybe take $year modulo 100.

Nope, can't do that. Not backwards compatible. The spec as always
read as is. Let's not penalize those who actually read.

--tom

@p5pRT
Copy link
Author

p5pRT commented Jan 26, 2000

From @andk

On Wed, 26 Jan 2000 04​:56​:51 -0700, Tom Christiansen <tchrist@​chthon.perl.com> said​:

Either you should add 1900 to $year or maybe take $year modulo 100.
Nope, can't do that. Not backwards compatible. The spec as always
read as is. Let's not penalize those who actually read.

The original poster reported a Y2K bug in pod2man.

The answer to that is that the bug has apparently been fixed in
perl5.005_03 by adding 1900 and in the development branch by getting
rid of the whole function.

--
andreas

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