TimeZone Problem

Questions and answers about change of functions, design, hosting etc.

Moderators: Koduc, Xpycm

Forum rules
Pay attention! Forum is not a means for guaranteed support of clients and users. An answer as well as a quick answer is not supposed on the forum. We post messages as soon as possible.

The message limit on the forum is 3 messages per day.
If you want to say "thank you" then use the function "Give good reputation point", which is a green icon "plus" under the nickname of the person, who answered the message.

TimeZone Problem

Postby luckyphan » 13 Sep 2018, 12:55

Hello,

We have changed the php.ini & user.ini timezone from the webserver & now the webserver has shown the correct timezone, but only from openrealestate, the timezone is still wrong. So any news posted & new listings posted are still showing wrong timezone - the server php.ini & user.ini timezone is already correct & updated.

How to adjust/change the timezone on the openrealestate ?

Thanks,
luckyphan
Stranger
 
Posts: 24
Joined: 30 Jul 2018, 09:09
Reputation point: 0

Re: TimeZone Problem

Postby Xpycm » 13 Sep 2018, 13:48

Hello.

In what incorrectness of a time zone is expressed? Please, provide screenshots and examples.

Look at the creation time (field `date_created`) of the news or articles in the database table. table {prefix}entries. Listings: table {prefix}apartments (field `date_created`) .

Mysql can have its own time zone: https://www.google.com/search?q=mysql+t ... 8&oe=utf-8
Try to set the same time zone for mysql as in php.ini
Dropbox
Open Real Estate CMS: FAQ | FAQ 2 | FAQ 3
Image
Xpycm
Web Developer
Web Developer
 
Posts: 281
Joined: 30 Dec 2011, 11:06
Reputation point: 2

Re: TimeZone Problem

Postby luckyphan » 14 Sep 2018, 06:24

Hi,

I was told by my hosting that they're not able to change the default SQL timezone, but there is a workaround :

*****************************************
So, in summary… once you’ve opened the mysql connection in your PHP script, just add these two lines:

date_default_timezone_set(‘Asia/Jakarta’);
mysql_query(“SET `time_zone` = ‘”.date(‘P’).”‘”);

And that’s about it.
****************************************

Now my question is : where should I paste this command on your OpenRealEstate ?

Thanks
luckyphan
Stranger
 
Posts: 24
Joined: 30 Jul 2018, 09:09
Reputation point: 0

Re: TimeZone Problem

Postby Xpycm » 14 Sep 2018, 08:23

mmm ... hosting provider can't change the time zone in its own server ... okaaaaay.

in index.php (in root directory)
before:
Code: Select all
$yii=dirname(__FILE__).'/framework/yii.php'

insert:
Code: Select all
date_default_timezone_set('Etc/GMT+7');;


and in protected/config/db.php
after:
Code: Select all
'tablePrefix' => 'YOUR_TABLES_PREFIX'

insert:
Code: Select all
'initSQLs' => array('SET time_zone = "+07:00";', 'SET @@session.time_zone = "+07:00";'),
Dropbox
Open Real Estate CMS: FAQ | FAQ 2 | FAQ 3
Image
Xpycm
Web Developer
Web Developer
 
Posts: 281
Joined: 30 Dec 2011, 11:06
Reputation point: 2

Re: TimeZone Problem

Postby luckyphan » 17 Sep 2018, 05:57

Thanks - shall try & test later.
luckyphan
Stranger
 
Posts: 24
Joined: 30 Jul 2018, 09:09
Reputation point: 0


Return to Questions and help for changes

Who is online

Users browsing this forum: No registered users and 5 guests

cron