Ad Widget

Collapse

Problem with Date.timezone setting.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scalft
    Junior Member
    • Apr 2008
    • 12

    #1

    Problem with Date.timezone setting.

    I am getting the following message on every screen I visit with a date/time combination.

    Code:
    date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. 
    Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. 
    In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. 
    We selected 'America/Chicago' for 'CST/-6.0/no DST' instead
    [/var/www/html/zabbix/include/blocks.inc.php:380]
    I have check the php.ini file. date.timezone is set to US/Central. I can't seem to figure out what I am missing.

    Thanks,

    Thad
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    What version of php are you using?
    Is the date.timezone line uncommented?

    Maybe try using one of the America time zones from this list:

    Comment

    • scalft
      Junior Member
      • Apr 2008
      • 12

      #3
      Additional Info.

      This is from a install of CentOS 5 update 4 fully patched.

      PHP version 5.1.6

      Code:
      PHP 5.1.6 (cli) (built: Jan 13 2010 17:13:05) 
      Copyright (c) 1997-2006 The PHP Group
      Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
      Date.Timezone setting.

      Code:
      ;;;;;;;;;;;;;;;;;;;
      ; Module Settings ;
      ;;;;;;;;;;;;;;;;;;;
      
      [Date]
      ; Defines the default timezone used by the date functions
      date.timezone = 'America/Chicago'

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        Check that link above and see if there is a setting in the America list that would serve your purpose. Worth a try.

        Comment

        • scalft
          Junior Member
          • Apr 2008
          • 12

          #5
          The timezone was just set to 'America/Chicago'. I re-tried it, and I still get the same behavior.

          Comment

          • tchjts1
            Senior Member
            • May 2008
            • 1605

            #6
            Strange indeed.

            So, you are changing it to America/xxxxxxx and restarting httpd, and then the system is still saying you have no date.timezone set, and it is changing it back to America/Chicago?

            FWIW, I do not use the tic marks around mine - America/Los_Angeles... that probably doesn't make a difference though, and looks like your system is inserting them without incident.

            Comment

            • scalft
              Junior Member
              • Apr 2008
              • 12

              #7
              It was the 'quotes' that caused the problem. Everything is good now.

              Thanks!!

              Comment

              • tchjts1
                Senior Member
                • May 2008
                • 1605

                #8
                Excellent. You're welcome.

                Comment

                Working...