-
-
Notifications
You must be signed in to change notification settings - Fork 245
Closed
Description
Currently it is not possible to obtain the current session time zone other than through workarounds like substring(current_timestamp from 26)
.
I think we should add:
RDB$GET_CONTEXT('SYSTEM', 'SESSION_TIME_ZONE')
MON$TIME_ZONE
inMON$ATTACHMENTS
Both should return the current session time zone (either named zone or offset in {+|-}HH:MM).
This would be similar to what is provided for the session idle timeout, which is accessible from the system context using RDB$GET_CONTEXT('SYSTEM', 'SESSION_IDLE_TIMEOUT')
and from MON$IDLE_TIMEOUT
in MON$ATTACHMENTS
.
Desired situation:
set time zone 'America/New_York';
select RDB$GET_CONTEXT('SYSTEM', 'SESSION_TIME_ZONE') from rdb$database;
-- returns 'America/New_York'
select MON$TIME_ZONE from MON$ATTACHMENTS where MON$ATTACHMENT_ID = CURRENT_CONNECTION;
-- returns 'America/New_York'
and
set time zone '+01:00';
select RDB$GET_CONTEXT('SYSTEM', 'SESSION_TIME_ZONE') from rdb$database;
-- returns '+01:00'
select MON$TIME_ZONE from MON$ATTACHMENTS where MON$ATTACHMENT_ID = CURRENT_CONNECTION;
-- returns '+01:00'