Re: Think I found a PHP bug

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

 



On 11/15/2011 2:58 PM, Tim Streater wrote:
> On 15 Nov 2011 at 22:34, Geoff Shang <geoff@xxxxxxxxxxxxxxx> wrote: 
> 
>> The bug is that if a server's timezone is set to Europe/London and you
>> don't set an explicit timezone in your script, if it's winter time in
>> the UK, PHP thinks the timezone is UTC instead of Europe/London.
> 
> I find I need to do this:
> 
>   date_default_timezone_set (@date_default_timezone_get ());
> 
> in all my scripts since 5.x.x to avoid rude messages.
> 
> --
> Cheers  --  Tim
> 
> 

Also, I recalled something from the early 5.1.0 version that was related to the
introduction of the date_timezone_set() function.  So, from there I searched
Google for "php changelog" and found the changelog for php v5.  Then I searched
that document for 'date_' and found that under the 5.1.0 they added the above
function.  How it is stated, it makes me think that PHP now requires you to call
this function prior to any use of other date functions.  I cannot find anything
in the php manual confirming my last statement.  YMMV

1 http://us3.php.net/manual/en/function.date-timezone-set.php
2 http://php.net/ChangeLog-5.php#5.1.0

-- 
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

C - (541) 408-5189
O - (541) 323-9113
H - (541) 323-4219

-- 
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