Re: Time::Local let me faint



John W. Krahn wrote:
Jeff Pang wrote:


$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,106)'
1157007600


For the instance described by you,both '2006' and '106' are right.

$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,106)'
1156953600
$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,2006)'
1156953600

The reason that '2006' works is because Time::Local makes a guess that '2006'
actually means '106'.

There is no "guesswork" involved. Time::Local has a very well
documented specific set of rules:

o Years greater than 999 are interpreted as being the
actual year, rather than the offset from 1900. Thus,
1963 would indicate the year Martin Luther King won the
Nobel prize, not the year 2863.

o Years in the range 100..999 are interpreted as offset
from 1900, so that 112 indicates 2012. This rule also
applies to years less than zero (but see note below
regarding date range).

o Years in the range 0..99 are interpreted as shorthand
for years in the rolling "current century," defined as
50 years on either side of the current year. Thus,
today, in 1999, 0 would refer to 2000, and 45 to 2045,
but 55 would refer to 1955. Twenty years from now, 55
would instead refer to 2055. This is messy, but matches
the way people currently think about two digit dates.
Whenever possible, use an absolute four digit year
instead.


Paul Lalli

.



Relevant Pages

  • Re: Another question for Jon
    ... In the SERIES formula, you can only refer to cell addresses by address, ... or to named ranges, which can themselves refer to cell ranges (using ... OFFSET etc.) or to arrays. ...
    (microsoft.public.excel.charting)
  • Re: How to dynamically change the series range of a chart ?
    ... Then if you get the chart series to point to "DataRange" as indicated ... Excel reports a "The formula you typed contains an error" when I try to ... I cannot get OFFSET to work on this... ... Series can refer to *names* rather than explicit ranges. ...
    (microsoft.public.excel.programming)
  • Re: compare file content
    ... If that is the case you might build a 4K buffer of 16 bit values ... To find the bit offset you simply mask off that last digit and ... array offset, simply divide the value by 16. ... You might look at it as using an array to denote if any value is ...
    (microsoft.public.scripting.vbscript)
  • Re: "What do you want from a mobile"
    ... How would the phone know in advance which number you've just said?...I refer to my partner who says "Twaah" for the digit "2" - many a recognition system would confuse this with the number "12". ...
    (uk.telecom.mobile)
  • Re: Refer in macro to cell
    ... I've created macro to make some calculations (and ... How can I refer to cell well I've inputed this function, ... use Offset method. ...
    (microsoft.public.excel.programming)