Hello, so I was doing some tests with timezone and found a probable bug related TZ (or some unread doc from myself)
Server: Centos 7
Updated tzdata-2023c-1.el7.noarch
Firebird-4.0.4.3010-0.amd64
firebird.conf:
default(empty).
Behavior is correct as expected, localtime is 09:50
localhost isql:
SQL> set list;
SQL> select * from RDB$CONFIG r where r.RDB$CONFIG_NAME in ('DefaultTimeZone');
RDB$CONFIG_ID 11
RDB$CONFIG_NAME DefaultTimeZone
RDB$CONFIG_VALUE <null>
RDB$CONFIG_DEFAULT <null>
RDB$CONFIG_IS_SET <false>
RDB$CONFIG_SOURCE <null>
SQL>
SQL> select localtime, current_time, cast(localtime as varchar(42)) as cast_localtime, cast(current_time as varchar(42)) as cast_current_time from rdb$database;
LOCALTIME 09:54:09.0000
CURRENT_TIME 09:54:09.0000 -03:00
CAST_LOCALTIME 09:54:09.0000
CAST_CURRENT_TIME 09:54:09.0000 -03:00
Remote isql (windows machine,
Firebird-4.0.4.3010-0.amd64)
SQL> set list;
SQL> select * from RDB$CONFIG r where r.RDB$CONFIG_NAME in ('DefaultTimeZone');
RDB$CONFIG_ID 11
RDB$CONFIG_NAME DefaultTimeZone
RDB$CONFIG_VALUE <null>
RDB$CONFIG_DEFAULT <null>
RDB$CONFIG_IS_SET <false>
RDB$CONFIG_SOURCE <null>
SQL> select localtime, current_time, cast(localtime as varchar(42)) as cast_localtime, cast(current_time as varchar(42)) as cast_current_time from rdb$database;
LOCALTIME 09:54:44.0000
CURRENT_TIME 09:54:44.0000 -03:00
CAST_LOCALTIME 09:54:44.0000
CAST_CURRENT_TIME 09:54:44.0000 -03:00
firebird.conf:
DefaultTimeZone = America/Sao_paulo
Behavior is incorrect, localtime is 09:50 and same timezone
localhost isql:
SQL> set list;
SQL> select * from RDB$CONFIG r where r.RDB$CONFIG_NAME in ('DefaultTimeZone');
RDB$CONFIG_ID 11
RDB$CONFIG_NAME DefaultTimeZone
RDB$CONFIG_VALUE America/Sao_paulo
RDB$CONFIG_DEFAULT <null>
RDB$CONFIG_IS_SET <true>
RDB$CONFIG_SOURCE firebird.conf
SQL> select localtime, current_time, cast(localtime as varchar(42)) as cast_localtime, cast(current_time as varchar(42)) as cast_current_time from rdb$database;
LOCALTIME 10:52:34.0000
CURRENT_TIME 10:52:34.0000 America/Sao_Paulo
CAST_LOCALTIME 10:52:34.0000
CAST_CURRENT_TIME 10:52:34.0000 America/Sao_Paulo
Remote isql (windows machine,
Firebird-4.0.4.3010-0.amd64)
select * from RDB$CONFIG r where r.RDB$CONFIG_NAME in ('DefaultTimeZone');
RDB$CONFIG_ID 11
RDB$CONFIG_NAME DefaultTimeZone
RDB$CONFIG_VALUE America/Sao_paulo
RDB$CONFIG_DEFAULT <null>
RDB$CONFIG_IS_SET <true>
RDB$CONFIG_SOURCE firebird.conf
select localtime, current_time, cast(localtime as varchar(42)) as cast_localtime, cast(current_time as varchar(42)) as cast_current_time from rdb$database;
LOCALTIME 10:51:38.0000
CURRENT_TIME 09:51:38.0000 America/Sao_Paulo
CAST_LOCALTIME 10:51:38.0000
CAST_CURRENT_TIME 10:51:38.0000 America/Sao_Paulo
TL;DR:
When defining DefaultTimeZone as the same local/infrastructure timezone, the output is phased in 1 hour+
Is this a bug? am I missing something?
Thanks!