Niras
Niras

Reputation: 13

Yii2 timezone error

I get "date_default_timezone_set(): Timezone ID '' is invalid" error suddenly on my running yii2 advanced project after clearing all data from database to upload to live server (Coincidentally, I know this has no relation). Same code is working on the live server but local computer(window xampp) show this error. I also tried changing the time zone from php.ini ...everything is fine. Other project also on yii2 advance are running fine. I also tried date_default_timezone_set('UTC'); in my file. I have searched for 2 days ..Everyone suggest to place timezone in php.ini or date_default_timezone_set('Asia/Kathmandu') on filedate. my php.ini portion looks like

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone=Asia/Kathmandu

error looks like: this I have looked at many question here like link,link

Upvotes: 0

Views: 528

Answers (1)

Niras
Niras

Reputation: 13

Actually,I found an solution. This error is due to clearing all data from database table before uploading to live server... accidentally i had deleted the data from option table (setting saved) that's why error occurred not Coincidentally. In my another server, I have not changed other table and updated only changed table so this server runs without error. To overcome this error, I have updated again this option table and everything fine. And this debugging created goes to senior developer Tej.Thank you Brother

Upvotes: 0

Related Questions