Jump to content

Timezone error : Invalid date.timezone value 'Asia/Calcuttaextension', we selected the timezone 'UTC' for now


lovedigit

Recommended Posts

Hello,

This is my first post on the website. Sorry, I din't went to the introduction section straight up. I am getting the following error on the website. The website was working fine before upgrading the php version. It would be a great help if someone could help me sort this out.

I have searched many other forum and this seems to be right place to ask for help. You guys seems to have a giant active community.

 

I don't have much knowledge about the php and stuff and I can't pay my developer to fix this :(

 

Warning: Unknown: Invalid date.timezone value 'Asia/Calcuttaextension', we selected the timezone 'UTC' for now. in Unknown on line 0

Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() expects exactly 1 parameter, 0 given' in /home/user/public_html/fw/init.php:59 Stack trace: #0 /home/user/public_html/fw/init.php(59): DateTimeZone->__construct() #1 /home/user/public_html/fw/init.php(82): fw::connect(Array) #2 /home/user/public_html/application.php(17): fw::config(Array) #3 {main} thrown in /home/user/public_html/fw/init.php on line 59

# Database
        require FW.'db'.DIRECTORY_SEPARATOR.DB_ADAPTER.'.php';
        
        db::connect(DB_HOST, DB_USER, DB_PASS);
        db::select_db(DB_NAME);
        
        # Timezone
        if(class_exists('DateTime'))
        {
            $date = new DateTime;
            
            if(method_exists($date, 'getOffset'))
            {
                $offset = $date->getOffset()/60;
                
                $minutes = abs($offset);
                $hours = floor($minutes/60);
                $minutes -= $hours*60;
                
                db::query('SET time_zone="'.sprintf('%+d:%02d', $hours*($minutes<0?-1:1), $minutes).'"');
            }
        }
    }

You're PHP setup has an invalid value for the date.timezone setting in php.ini. You need to determine what the correct setting should be and then update the php.ini and restart the server.

 

Based on what you have, and the list at http://us1.php.net/manual/en/timezones.asia.php I'd say you probably want to set it to 'Asia/Calcutta'

The Timezone issue has been fixed.

I did the following:


-->> Created the Customized php.ini file under the document root.
-->> There was a problem with the 'Timezone' line in php.ini which I rectified.

[
date.timezone = "Asia/Calcutta"
extension=pdo.so
]

Above lines must be in a seperate line which was earlier in the same line.

:)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.