Re: _php3_mktime

From: Date: Wed, 23 Jun 1999 17:47:35 +0000
Subject: Re: _php3_mktime
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-7466@lists.php.net to get a copy of this message
On Jun 22, Cole Tuininga wrote: > > I was taking a look at the new _php3_mktime code and had a question or > two. > > a) The following code segment confuses me: > > if (gm) > ta.tm_isdst = 0; > else > ta.tm_isdst = -1; > > if (arg_count > 6) > ta.tm_isdst = arguments[6]->value.lval; > > This, to me, seems to say that if they don't specify the daylight > savings time effect for the time stamp in question, that it will > automatically assume they are in -1 mode? Instead, shouldn't we grab an > actual timestamp at this point and let the system determine the isdst? We are letting the system determine the isdst based on the timestamp being passed to mktime(). This is what setting is_dst to -1 does. The only change to this code in the "new" mktime() is the addition of allowing the is_dst flag to be specified with another optional parameter. We were always setting it to -1 before (or 0 when calling gmmktime()). > b) We're making the assumption that a negative value for tm_min and > tm_hour are ok. Is this safe on all platforms? The only platform I > currently have access to is Linux, and it does work there... There have never been any bugs reported based on this behavior. Jim

« previous php.dev (#7466) next »