date() and php53

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed Apr 28 12:09:28 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 28/04/2010 16:54:45, Matt Dawson wrote:
> Just a quick heads-up for anyone who has updated to php53 and is now 
> getting an error message where the header should be in webui. The 
> date() function now requires a timezone and won't rely on the system's 
> timezone setting by default. Sticking the following:
> 
> date_default_timezone_set('Europe/London');
> 
> at the top of $pb/scripts/webui/index.php (obviously replacing 
> Europe/London with your timezone) just below the <?php line will get 
> rid of that error. Don't be tempted to just slam UTC in there, though.
> 
> There's probably a better way to automate this, but as a quick fix it 
> works.

Uh --- why not put that setting in php.ini?

worm:/usr/local/etc:% diff -u php.ini-production php.ini
- --- php.ini-production  2010-04-10 17:06:53.000000000 +0100
+++ php.ini     2010-04-27 15:53:52.000000000 +0100
@@ -1002,7 +1002,7 @@
 [Date]
 ; Defines the default timezone used by the date functions
 ; http://php.net/date.timezone
- -;date.timezone =
+date.timezone = Europe/London

 ; http://php.net/date.default-latitude
 ;date.default_latitude = 31.7667

Means it works for all php applications.

	Cheers,

	Matthew

- -- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvYXbcACgkQ8Mjk52CukIxD+wCdF6/6wcgu6vwSVIBCpCNrcuds
b+kAn0spcct6esI/ZXjUf1/LeROOc6uJ
=AdmB
-----END PGP SIGNATURE-----


More information about the tinderbox-list mailing list