Re: Testing strtotime()..
| From: | Andrei Zmievski | Date: | Tue, 20 Jun 2000 13:50:53 +0000 |
| Subject: | Re: Testing strtotime().. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-21833@lists.php.net to get a copy of this message | ||
On Tue, 20 Jun 2000, jtaskine@hit.fi wrote:
>
> This script:
>
> <?php
>
> echo strtotime("Fri, Jun 16 2000 16:51:15 GMT-0500") ."<br>";
> echo strtotime("Fri, Jun 16 2000 16:51:15 GMT -0500") ."<br>";
> echo strtotime("Fri, Jun 16 2000 16:51:15 -0500") ."<br>";
> echo strtotime("Fri, 16 Jun 2000 16:51:15 GMT-0500") ."<br>";
> echo strtotime("Fri, 16 Jun 2000 16:51:15 GMT -0500") ."<br>";
> echo strtotime("Fri, 16 Jun 2000 16:51:15 -0500 GMT") ."<br>";
> echo strtotime("Fri, 16 Jun 2000 16:51:15 -0500 (GMT)") ."<br>";
>
> ?>
>
> Output with PHP4-cvs (latest..about 10 minutes ago):
>
> -1
> -1
> -1
> -1
> -1
> -1
> 961192275
>
> And output with PHP3.0.14:
>
> -1
> -1
> -1
> 961192275
> 961192275
> 961174275
> 961192275
For better or for worse, that's how it is. The algorithm is taken from
the GNU date command and is pretty much de facto.
-Andrei
"The galaxy is, in other words, an immensely, intrinsically,
and inexhaustibly interesting place." -- Iain M. Banks