Re: mktime problem...
| From: | Jonathan Hernandez | Date: | Mon, 19 Jan 2004 23:51:04 +0000 |
| Subject: | Re: mktime problem... | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7194@lists.php.net to get a copy of this message | ||
Well, I see that is a normal behavior of libc/mktime (it returns -1 if
an error was detected), I see others have the same problem and
implements their own php/mktime function (see the first comment on
http://www.php.net/mktime)... I wonder if it can be
implemented directly
on the php function...
On Mon, 2004-01-19 at 13:05, Wez Furlong wrote:
> Your libc doesn't support negative time_t values.
>
> --Wez.
>
> ----- Original Message -----
> From: "Jonathan Hernandez" <ion@gluch.org.mx>
> To: <internals@lists.php.net>
> Sent: Monday, January 19, 2004 7:20 PM
> Subject: [PHP-DEV] mktime problem...
>
>
> > Hello,
> >
> > I have a problem with mktime, when I try to run this:
> >
> > <?php
> > $date = getdate(mktime(12, 0, 0, 1, 1 ,1959));
> > echo $date[0]."
> >
> > ".$date['mday']."-".$date['mon']."-".$date['year']."<br/>";
> > $date = getdate(-347090400);
> > echo $date[0]."
> >
> > ".$date['mday']."-".$date['mon']."-".$date['year']."<br/>";
> > ?>
> >
> > Output:
> > -62 31-12-1969
> > -347090400 1-1-1959
> >
> > I compile php5.0b3 on Fedora(gcc 3.3.2/ kernel 2.4.22), if I try to run
> > it on Debian (gcc 2.95.4 / kernel 2.6.0) it works fine,
> >
> > Output:
> > -347090400 1-1-1959
> > -347090400 1-1-1959
> >
> >
> > Both php are compiled with the same ./configure line...
> >
> >
> > Any idea about this?
>
>