Topic: Need to fix time zone for JB site
Hello,
How can I set the time zone for my website. I have used
SetEnv TZ :Asia/Saigon
in my .htaccess but it still doesnot work
Welcome to jobberBase Developer Community!
You are not logged in. Please login or register.
We've just added a new category for forums dedicated to local communities.
If you're interested in starting a community in your country or even city, please write us at hello@jobberbase.com and we'll make it happen.
We're also looking for moderators on each local community -- so email us :).
Pages: 1
Hello,
How can I set the time zone for my website. I have used
SetEnv TZ :Asia/Saigon
in my .htaccess but it still doesnot work
you need to add this in config.php, where is says romania there
More specifically, you'll have to change date_default_timezone_set('Europe/Bucharest'); to what you need (in config.php)
I've tried using the date_default_timezone_set() but it's not working as well.
Can you please post here what exactly did you try?
hi putypuruty! thanks for the quick reply.
I changed my config.php to reflect this one
date_default_timezone_set('Asia/Hong_Kong');
but all my posts still reflect Jan 14th instead of Jan 15th. (I usually post around 7am Jan 15th)
I also tried the GMT+8 but didn't work out as well.
EDITED.
Posts made around 1pm or 2pm, get Jan 15 date stamped on them. Anything earlier than this period gets Jan 14th.
Last edited by cloudduster (2011-01-15 02:14:31)
Sorry to ask, but you've changed the line
date_default_timezone_set('Europe/London');to
date_default_timezone_set('Asia/Hong_Kong');right?
I'm asking because 2 posts above I was saying what to do for an older jobberbase version. So, I hope you've edited the existing line instead of adding a new line with the new time zone.
Anyhow, I assume that the problem is caused by the fact that inside the SQL queries, the mysql database server's current time is used (the function now()) and not php's time (which would take into consideration the time zone). If the database server is on a different time zone, then you can run into the problem that you've just mentioned. I guess that you're site is hosted somewhere in the US or Europe and thus the database server's time is not the time in Hong Kong.
The truth is that this is actually a bug in jobberbase, I wonder why we didn't discover this sooner.
I don't know what workaround to suggest for the time being other than hosting your site at a company in Hong Kong.
Sorry, I was a little bit hasty with my previous response.
The fix is actually pretty simple: open _config/config.php and add the following line
$db->Execute('SET time_zone = "+8:00"');after the line
$db->Execute('SET NAMES UTF8');I hope that +8:00 is the correct time zone for you ![]()
Hope it helps!
This one worked! Thanks!
Sorry, I was a little bit hasty with my previous response.
The fix is actually pretty simple: open _config/config.php and add the following line
Code:$db->Execute('SET time_zone = "+8:00"');after the line
Code:$db->Execute('SET NAMES UTF8');I hope that +8:00 is the correct time zone for you
Hope it helps!
Posts [ 9 ]
Pages: 1
Powered by FluxBB
[ Generated in 0.034 seconds, 9 queries executed ]