FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Date/Time warning
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Date/Time warning [message #177756 is a reply to message #177746] Fri, 20 April 2012 09:23 Go to previous messageGo to previous message
Tim Streater is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: php include, function, ...
Next Topic: session question
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 01 02:30:29 GMT 2024

Total time taken to generate the page: 0.04129 seconds