Re: Logical reason for strtotime('east') and strtotime('west') returning valid results?
| From: | Kevin Kinsey | Date: | Mon, 05 Apr 2010 18:15:32 +0000 |
| Subject: | Re: Logical reason for strtotime('east') and strtotime('west') returning valid results? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303840@lists.php.net to get a copy of this message | ||
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