cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Timezone per server/database

Former Member
4,924

We host database for some online applications and some of our new customers are located in another timezone.

Since we have all database running in just one box, is that possible to configure timezone in database/db server, this way sa will not use OS timezone.

Accepted Solutions (0)

Answers (2)

Answers (2)

In the option "PUBLIC.time_zone" with "Simulated Time Zones" seems to do this in the current version (Anywhere 17)

CREATE TIME ZONE NewSouthWales OFFSET '10:00'
STARTING 'Oct/Sun>=1' AT '2:00'
ENDING 'Apr/Sun>=1' AT '2:00';

SET OPTION PUBLIC.time_zone='NewSouthWales';
VolkerBarth
Contributor

What version are you using?

AFAIK, v12 has introduced the new data type TIMESTAMP WITH TIME ZONE and the new special value CURRENT UTC TIMESTAMP exactly for such use cases.

Former Member
0 Likes

Actually it's all in 11. We are planning to upgrade to 12 this year.

Former Member
0 Likes

FYI, DEFAULT UTC TIMESTAMP and CURRENT UTC TIMESTAMP have been around since version 8, but before version 12 their type was TIMESTAMP.

VolkerBarth
Contributor
0 Likes

Now I'm somewhat puzzled what exactly has been improved with v12:

  • Does v8+ (and the "time_zone_adjustment" option) allow a client to adjust the display of UTC time values to the local timezone (i.e. it allows to correct between displayed and stored times? (But one should still store UTC times in case different time zones do matter, e.g. with the help of DEFAULT/CURRENT UTC TIMESTAMP.)

  • Whereas the v12 TIMESTAMP WITH TIME ZONE type allows the storage of times with local time zone information, so clients do not need to adjust the display, and the time can still be stored in a standardized way?

Former Member

Before version 12, one always needed to know what timezone was used for values in timestamp columns. All that DEFAULT/CURRENT UTC TIMESTAMP provided were ways to get UTC timestamps instead of the timestamps in the local server OS timezone provided by DEFAULT/CURRENT TIMESTAMP.