Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for timestamp with timezone (Firebird 4+) #55

Open
kuerbis opened this issue Mar 29, 2024 · 1 comment
Open

support for timestamp with timezone (Firebird 4+) #55

kuerbis opened this issue Mar 29, 2024 · 1 comment

Comments

@kuerbis
Copy link

kuerbis commented Mar 29, 2024

Hi, when I use a timestamp with timezone in dateadd, the result is unknown. The Firebird version is '4.0.4'.


my $dbh = DBI->connect( "dbi:Firebird:dbname=$db", $user, $passwd ) or die DBI->errstr;

my $table = 'test_table_unix_seconds';
my $col = 'sec';

$dbh->do( "RECREATE TABLE $table ($col INT)" );
$dbh->do( "INSERT INTO $table ($col) VALUES(86400)" );

my $sth = $dbh->prepare( "SELECT $col, dateadd(SECOND,$col,TIMESTAMP '1970-01-01') FROM $table" );
$sth->execute();
$sth->dump_results;
# 86400, 'Fr 02 Jan 1970 00:00:00 CET'

$sth = $dbh->prepare( "SELECT $col, dateadd(SECOND,$col,TIMESTAMP '1970-01-01 UTC') at time zone 'CET' as ts FROM $table" );
$sth->execute();
$sth->dump_results;
# 86400, '** unknown **'

It works using isql:

#SQL> SELECT sec, dateadd(SECOND,sec,TIMESTAMP '1970-01-01 UTC') at time zone 'CET' as ts FROM test_table_unix_seconds;
#
#         SEC                                                        TS
#============ =========================================================
#       86400 1970-01-02 01:00:00.0000 CET
@real-dam
Copy link
Collaborator

DBD-Firebird doesn't support 'timestamp with time zone' data type yet. you may workaround this by using data type mapping. See https://firebirdsql.org/file/documentation/html/en/refdocs/fblangref40/firebird-40-language-reference.html#fblangref40-management-datatypes

@real-dam real-dam changed the title Firebird 4: timestamp with timezone in dateadd support for timestamp with timezone (Firebird 4+) Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants