develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [ID 20010702.001] localtime() returns incorrect day-in-the-year value

Thread Previous
From:
Ronald J Kimball
Date:
July 2, 2001 10:23
Subject:
Re: [ID 20010702.001] localtime() returns incorrect day-in-the-year value
Message ID:
20010702132315.A249304@linguist.thayer.dartmouth.edu
On Mon, Jul 02, 2001 at 01:15:33PM -0400, schwern@pobox.com wrote:
> On Sun, Jul 01, 2001 at 06:52:51PM -0400, Kenneth Tomiak wrote:
> > localtime returned 181, but I know it is 182.
> 
> localtime's year day mirror's C's localtime() function and January 1st
> is 0, not 1, that's probably the confusion here. :( Sorry to make you
> go through all that work.
> 
> I'll patch up perlfunc to document that.

perl5.6.1's perlfunc has the correct information regarding the yday return
value from localtime.

5.005_03's perlfunc did not mention the range for yday at all, and
5.6.0's perlfunc mistakenly said 1..365 instead of 0..364.

Ronald

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About