Re: PHP 4.0 Bug #5041: strtotime() parsing is sometimes supprising
| From: | R. P. Channing Rodgers, M.D. | Date: | Thu, 15 Jun 2000 15:31:14 +0000 |
| Subject: | Re: PHP 4.0 Bug #5041: strtotime() parsing is sometimes supprising | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21433@lists.php.net to get a copy of this message | ||
> From php-dev-return-21347-rodgers=nlm.nih.gov@lists.php.net Wed Jun 14 17:17:43 2000
>
> On Wed, 14 Jun 2000, hartmut@six.de wrote:
> > From: hartmut@six.de
> >
> > "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"
> >
> >
> > and i'm sure there is more of this
>
> strtotime() is due for a massive upgrade. Stay tuned.
>
> -Andrei
At the risk of looking naive (because you may be following some standard
for representation of time of which I'm unaware), the representation
of time in the form of 2000 seems inherently dangerous to me, due to its
ambiguity. I'd suggest that time should always contain a colon
separator for purposes of disambiguity, as in:
6 June 2000 20:00:43
or
6 June 2000 20:00
etc.
Cheerio, Rick Rodgers