Re: PHP 4.0 Bug #4833: date conversions dont work
| From: | Hartmut Holzgraefe | Date: | Tue, 06 Jun 2000 10:22:31 +0000 |
| Subject: | Re: PHP 4.0 Bug #4833: date conversions dont work | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-20311@lists.php.net to get a copy of this message | ||
Mike Robinson wrote:
> Oddly enough...
>
> $first = strtotime ("6 June 2000");
> print (date("l dS of F Y h:i:s A", $first));
>
> produces "Monday 05th of June 2000 03:00:00 PM", but,
>
this seems to be timezone related, i get the right date
at 3am here in germany
> $first = strtotime ("June 6 2000");
> print (date("l dS of F Y h:i:s A", $first));
>
> produces "Tuesday 06th of June 2000 11:00:00 AM".
>
this is a combination of timezone and parser/grammer problem
"June 6 2000" is interpreted as
"June 6, current year, 20 hours, 00 minutes"
(20 hours ahead of your first result)
"June 6, 2000" would be
"June 6, year 2000"
as i am not a native speaker i'm not sure about conventions here,
but i would have guessed it being the other way round?
it sure is in my german way of thinking
so besides the timezone problem: should the grammer in parsedate.y
be changed, breaking compatibility with other packages using
parsedate or should we just extend the manual entry to give
definitions and examples for the supported formats ?
--
Hartmut Holzgraefe hartmut@six.de http://www.six.de