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).'"');
            }
        }
    }
Link to comment
Share on other sites

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'

Link to comment
Share on other sites

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.

:)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.