in reply to Year Value Interpretation

A first step is to use a correct value for the month, which should be in the range from 0 to 11.

The problem with years > 138 is that timestamps for the year 2038 don't fit into a 32 bit integer anymore.

This is fixed in current bleadperl. Maybe also some CPAN modules do correct date manipulation beyond 2038, maybe you should try some of them.

Update: I'm a bit curious - what do you need post-2038 dates for?

Second update: If you want to play with it a bit more I recommend POSIX::mktime:

# start of epoch $ perl -MPOSIX=mktime -wle 'print mktime(0,0,1,1,0,70);' 0 but true # before epoch $ perl -MPOSIX=mktime -wle 'print mktime(0,0,1,1,0,60);' -315619200 # "normal" dates: perl -MPOSIX=mktime -wle 'print mktime(0,0,1,1,0,100);' 946684800 # how close do we get to 2**32-1 ? $ perl -MPOSIX=mktime -wle 'print mktime(7,14,4,19,0,138);' 2147483647 $ perl -MPOSIX=mktime -wle 'print mktime(8,14,4,19,0,138);' Use of uninitialized value in print at -e line 1.

Replies are listed 'Best First'.
Re^2: Year Value Interpretation
by Anonymous Monk on Apr 18, 2008 at 11:36 UTC
    oops I misstyped that one while writing here I am paasing these from variables and these are valid as month 0..11 date 1..31
      also the year between 50-58 ..its taking it as 150-158 so gives error again as can't handle timelocal(0,0,0,11,11,15x) x:0..8 but its works with 59 I am quite confused abt this