Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-11-26 11:01:11

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 619
Website

How to sync server and database timezones please?

Hi, I would like to get some help with servers and databases timezones issue please.

My localhost server timezone is UTC,
and I have set the Timezone setting in TXP preferences to Tokyo.

My live server timezone is America/Chicago,
and I have set the Timezone setting in TXP preferences to Tokyo.

By them being different it is causing wrong publishing times for articles.

I have create a php.ini file with the following line of code: date.timezone = "UTC" and uploaded it to the live server.
Now in the TXP diagnostics page is says that the live server timezone is UTC,
but the actual timezone GMT offset in seconds is different and not the right one as in my localhost.

Also the databases times are different, how can I solve this issue please?

local:

Server timezone: UTC
Server local time: 2020-11-26 10:48:23
Daylight Saving Time enabled?: 0
Automatically adjust Daylight Saving Time setting?: 0
Time zone (GMT offset in seconds): Asia/Tokyo (7200)
MySQL: 8.0.18 (MySQL Community Server – GPL)
Database server time: 2020-11-26 12:48:23
Database server time offset: 0 s
Database server timezone: SYSTEM
Database session timezone: SYSTEM

live:

Server timezone: UTC
Server local time: 2020-11-26 10:48:53
Daylight Saving Time enabled?: 0
Automatically adjust Daylight Saving Time setting?: 0
Time zone (GMT offset in seconds): Asia/Tokyo (32400)
MySQL: 5.6.41-84.1 (Percona Server (GPL), Release 84.1, Revision b308619)
Database server time: 2020-11-26 04:48:53
Database server time offset: 0 s
Database server timezone: SYSTEM
Database session timezone: SYSTEM

Offline

#2 2020-11-27 19:16:29

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 619
Website

Re: How to sync server and database timezones please?

For a workaround I ended up using SQL queries to reduce 8 hours from the posted and expires times.

update textpattern
    set Posted = Posted - interval 8 hour;
update textpattern
    set Expires = Expires - interval 8 hour;

Offline

Board footer

Powered by FluxBB