I don't see how you arrive at this conclusion. When I modify the input dates to read 200 and 205 respectively, the program crashes. When I modify the dates to be 2000 and 2005 respectively, the program completes properly.

This program shows how the year is handled:

use strict; use warnings; use Time::Piece; my $t2 = localtime; print "Time is $t2\n"; print "Year is ", $t2->year, "\n";

The output of that is

Time is Tue Dec 13 22:57:39 2005 Year is 2005
That is as expected.

The documentation for Time::Piece shows these two methods:

$t->year # based at 0 (year 0 AD is, of course 1 BC) $t->_year # year minus 1900

I think it's clear that $t->year is simply the "zero" based year as we know them, and the $t->_year method is the year as we get it from the localtime function.


In reply to Re^5: Time::Piece strangeness take two by spiritway
in thread Time::Piece strangeness take two by InfiniteLoop

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.