2009/10/3 Stefan Schulz <[email protected]>:
>
> Hi there,
>
> I've run into a strange behaviour with daylight saving on an Ubuntu
> feisty server:
> consider the following program date.php:
>
> <?php
> date_default_timezone_set  ( 'Pacific/Auckland'  );
> echo date('r');
> ?>
>
> Here is the command line output (feisty):
> s...@weather:~$ date
> Sat Oct  3 20:42:34 NZDT 2009
> s...@weather:~$ php -f date.php
> Sat, 03 Oct 2009 19:42:46 +1200
>

Confusingingly enough, both those are correct - the PHP output is
outputting in Standard time (NZST).  I assume that the versions of PHP
are different on both servers?  I suspect that one of the libraries
underpinning your setup is not picking up the correct timezone
information.


> The same program on my Ubuntu Jaunty:
> s...@pluto:~$ date
> Sat Oct  3 20:45:25 NZDT 2009
> s...@pluto:~$ php -f date.php
> Sat, 03 Oct 2009 20:45:32 +1300
>
> I copied the Pacific/Auckland timezone data file from Jaunty to the
> Feisty system, but no change. Both systems do not have a default
> timezone set in php.ini and the behaviour does not change whether I call
> date_default_timezone() in the script or not.

Perusing this page http://nz.php.net/manual/en/timezones.php seems to
imply that PHP uses it's own timezone database internally.

Upgrading the version of PHP will most likely assist in this case ....

HTH.

>
> I'm puzzled. Any pointer much apprechiated.
>
> Cheers
> Stefan
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to