Re: Logical reason for strtotime('east') and strtotime('west') returning valid results?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Colin Guthrie wrote:

For example, I discovered that some words (or strings beginning with
those words) will return false positives:

e.g.:

[colin@jimmy Search (working)]$ php -r 'var_dump(strtotime("east"));'
int(1270514111)
[colin@jimmy Search (working)]$ php -r 'var_dump(strtotime("west"));'
int(1270488914)
[colin@jimmy Search (working)]$ php -r 'var_dump(strtotime("now"));'
int(1270488928)


The last one is valid! But the other two appear to do much the same thing...

Can anyone think of why this would be valid results before I report this
to the relevant authorities?

Time Zones?

[11] Mon 05.Apr.2010 13:05:41 [admin@archangel][~]
php -r "echo date('r',strtotime('now'));"
Mon, 05 Apr 2010 13:05:47 -0500

This is correct for my timezone (US Central Daylight Time).

[12] Mon 05.Apr.2010 13:05:47 [admin@archangel][~]
php -r "echo date('r',strtotime('east'));"
Mon, 05 Apr 2010 14:05:51 -0500

This is correct for the time zone east of me, US Eastern Daylight Time.
However, the TZ offset is wrong for that TZ, it's still mine.

[13] Mon 05.Apr.2010 13:05:51
[kadmin@archangel][~]
php -r "echo date('r',strtotime('west'));"
Mon, 05 Apr 2010 07:05:59 -0500

This is correct for American Samoa, but I've no idea why :-D

Nonetheless, I'm suspecting the programmers had something
like this in mind.  Isn't strtotime() based on some GNU utility?

Kevin Kinsey

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux