5:10pm {638} localhost:/home/webadmin/>$ cat mydate
#!/usr/bin/perl -l
use Date::Parse qw/str2time/;
my $d = $ARGV[0];
my $utime = str2time("01/01/$d");
print "$utime\t", scalar localtime $utime;

5:10pm {639} localhost:/home/webadmin/>$ ./mydate 1956
-441831600      Sun Jan  1 00:00:00 1956
5:10pm {640} localhost:/home/webadmin/>$ ./mydate 1955
Day too big - 31046 > 24854
Sec too small - 31046 < 74752
        Wed Dec 31 19:00:00 1969
5:10pm {641} localhost:/home/webadmin/>$ ./mydate 1937
2114398800      Thu Jan  1 00:00:00 2037
5:10pm {642} localhost:/home/webadmin/>$ ./mydate 1938
2145934800      Fri Jan  1 00:00:00 2038
5:10pm {643} localhost:/home/webadmin/>$ ./mydate 1939
Day too big - 25202 > 24854
Sec too small - 25202 < 74752
        Wed Dec 31 19:00:00 1969
5:10pm {644} localhost:/home/webadmin/>$ ./mydate 1945
Day too big - 27394 > 24854
Sec too small - 27394 < 74752
        Wed Dec 31 19:00:00 1969

4:56pm {617} localhost:/home/webadmin/>$ uname -a
Linux localhost 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686
athlon i386 GNU/Linux

4:57pm {620} localhost:/home/webadmin/>$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
  Platform:
    osname=linux, osvers=2.4.21-27.0.2.elsmp,
archname=i386-linux-thread-multi
    uname='linux decompose.build.redhat.com 2.4.21-27.0.2.elsmp #1 smp
wed jan 12 23:35:44 est 2005 i686 i686 i386 gnulinux '
    config_args='-des -Doptimize=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -m32 -march=i386 -mtune=pentium4
-fasynchronous-unwind-tables -Dversion=5.8.6 -Dmyhostname=localhost
[EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc.
-Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux
-Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads
-Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db
-Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio
-Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly
-Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto
-Ud_endprotoent_r_proto -Ud_endservent_r_proto -Ud_sethostent_r_proto
-Ud_setprotoent_r_proto -Ud_setservent_r_proto -Dinc_version_list=5.8.5
5.8.4 5.8.3'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32
-march=i386 -mtune=pentium4 -fasynchronous-unwind-tables',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING
-fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='4.0.0 20050516 (Red Hat 4.0.0-6)',
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread
-lc
    perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.3.5.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.3.5'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at May 18 2005 18:21:23
  @INC:
    /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.6
    /usr/lib/perl5/site_perl/5.8.5
    /usr/lib/perl5/site_perl/5.8.4
    /usr/lib/perl5/site_perl/5.8.3
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.6
    /usr/lib/perl5/vendor_perl/5.8.5
    /usr/lib/perl5/vendor_perl/5.8.4
    /usr/lib/perl5/vendor_perl/5.8.3
    /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/5.8.6/i386-linux-thread-multi
    /usr/lib/perl5/5.8.6

cpan> m Time::Local
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
  Database was generated on Fri, 01 Jul 2005 12:57:58 GMT
Module id = Time::Local
    DESCRIPTION  Implements timelocal() and timegm()
    CPAN_USERID  P5P (The Perl5 Porters Mailing List
<perl5-porters@perl.org>)
    CPAN_VERSION 1.11
    CPAN_FILE    D/DR/DROLSKY/Time-Local-1.11.tar.gz
    DSLI_STATUS  Supf (standard,comp.lang.perl.*,perl,functions)
    MANPAGE      Time::Local - efficiently compute time from local and
GMT time
    INST_FILE    /usr/lib/perl5/5.8.6/Time/Local.pm
    INST_VERSION 1.11


cpan> m Date::Parse
Module id = Date::Parse
    DESCRIPTION  ASCII Date parser using regexp's
    CPAN_USERID  GBARR (Graham Barr <[EMAIL PROTECTED]>)
    CPAN_VERSION 2.27
    CPAN_FILE    G/GB/GBARR/TimeDate-1.16.tar.gz
    DSLI_STATUS  Rdpf (released,developer,perl,functions)
    MANPAGE      Date::Parse - Parse date strings into time values
    INST_FILE    /usr/lib/perl5/site_perl/5.8.6/Date/Parse.pm
    INST_VERSION 2.27

There is what I have installed, along with some short one-liners
demonstrating the problem.

I don't believe it's the Fedora core 4 internals, as the commandline
date function seems to have no trouble with dates in those ranges:

5:02pm {623} localhost:/home/webadmin/>$ date -d "01/01/1958"
Wed Jan  1 00:00:00 EST 1958
5:02pm {624} localhost:/home/webadmin/>$ date -d "01/01/1955"
Sat Jan  1 00:00:00 EST 1955
5:02pm {625} localhost:/home/webadmin/>$ date -d "01/01/1940"
Mon Jan  1 00:00:00 EST 1940
5:02pm {626} localhost:/home/webadmin/>$ date -d "01/01/1912"
Mon Jan  1 00:00:00 EST 1912

I don't know where to start looking, on this, but am certainly willing
to help test it. I'm in the middle of a project converting a load of
data and *need* to get past this. :) Anything I can do to help, let me
know. 

-scott

Reply via email to