Re: Date/Time warning [message #177756 is a reply to message #177746] |
Fri, 20 April 2012 09:23 |
Tim Streater
Messages: 328 Registered: September 2010
Karma:
|
Senior Member |
|
|
In article <2012042008442967926-info@stconinccom>,
Torsten Jørgensen <info(at)stconinc(dot)com> wrote:
> I get a warning about timezones when using date(). Is there something
> new in PHP, I've just migrated from one mac to another.
You've upgraded to a version that needs it. I do this in any CLI PHp
script I run, if I'm going to use any time/date function:
$timezone = getHosttimezone (); // Ask system for time zone
date_default_timezone_set ($timezone);
Since most of my scripts are run by apache, I also do this in the
httpd.conf file:
php_value date.timezone 'timezone-string'
where you replace timezone-string with the string for your time-zone.
Under OS X 10.7.3, this file is at:
/private/etc/apache/httpd.conf
php.ini.default can be found at:
/private/etc/php.ini.default
You probably want to copy that to php.ini in the same directory and then
edit as others have suggested.
--
Tim
"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
|
|
|