I need to address an issue which happens when Firebird server date is different from date/time settings of local Windows desktop running the app.
At my development machine Firebird 2.5 runs as Windows service. Is there any way to set Firebird date to be different from system date?
Expected result would be SELECT CURRENT_DATE from rdb$database
indicating different date then one visible in the Windows system tray.
No, that is not possible in Firebird 2.5. Firebird always uses the system time, and in Firebird 3.0 and older, will always use the time in the system timezone.
In Firebird 4.0 and higher, you can configure the default session timezone of attachments to the server using setting DefaultTimeZone
in firebird.conf. Clients can specify their session timezone in the DefaultTimeZone
in firebird.conf of the fbclient they're using, or using the isc_dp_session_time_zone
connection property to configure it per connection, or using SET TIME ZONE
to change the timezone of a connection on the fly.
In Firebird 4.0, the CURRENT_DATE
value will report the date in the session timezone (which will not necessarily match the timezone of the server), and CURRENT_TIMESTAMP
is now a TIMESTAMP WITH TIME ZONE
, reporting the time and date and timezone for the session timezone. The timezoneless alternative is called LOCALTIMESTAMP
which will also report the time and date in the session timezone (but without reporting the timezone).
That said, even in Firebird 4.0 and higher, the time and date will still be bound to the server time, it will just be possible to get the same instant in a different timezone (e.g. the one used by your client).