Thanks for your help Adam. You are absolutely right... it was an unset variable.
I am using the Date::Parse module and the &Date::Parse::str2time function does not seem to be able to handle dates less than "1953-01-01". Doh! simran. On Thu, 2002-11-28 at 11:08, Adam Turoff wrote: > On Thu, Nov 28, 2002 at 10:20:46AM +1100, simran wrote: > > Hi All, > > > > When i use the 'localtime' function in perl 5.6.1 if i pass it an epoch > > time of less than 0 then i always get the date of: > > > > * "Wed Dec 31 19:00:00 1969" > > > > Is there a method someone knows of (other function, cpan module?, > > anything) that will let me convert epochs of less than 0 to valid > > date/time strings? > > > > I am using Date::Parse::str2time and that produces epochs of less than > > zero. > > localtime() does indeed work with negative values: > > $ perl5.6.1 -e 'print scalar localtime (-1), "\n"' > Wed Dec 31 18:59:59 1969 > > $ perl5.6.1 -e 'print scalar localtime (-1_000_000), "\n"' > Sat Dec 20 05:13:20 1969 > > $ perl5.6.1 -e 'print scalar localtime (-1_000_000_000), "\n"' > Sun Apr 24 18:13:20 1938 > > Maybe the bug is somewhere else in your code? Sounds like you're > rounding negative values to zero before calling localtime(). > > Z. > >
