FireBird 5.0 / Summer Time / Time Zone

134 views
Skip to first unread message

ABAK

unread,
Aug 17, 2024, 1:24:52 PM8/17/24
to firebird-support
Hello everyone,

A little problem with summer time, under FireBird 5.0:

- In Firebird 2.5.9:
Select Current_Time From RDB$DataBase;
Always provided the OS (Server) time, regardless of the Time Zone. It was simple and logical.

- Today in FireBird 5.0, Current_Time will fetch the Time Zone (in FireBird.Conf)
and provides, not the OS time, but that of the Time Zone.
OK, I agree.

But, How to find the real time of the Os in FireBird 5.0 without Time Zone?

- In Doc Fb 5.0 it is indicated:
To find the Server time without Time Zone:

1. Leave DefaultTimeZone = (empty) in FireBird.Conf
2. and use instead:
Select LocalTime From RDB$DataBase;
I try:
it always gives Hour +1 (Summer time)
while my windows displays 12:00, the query indicates 13:00
( summer time  is disabled in my windows settings).
The desired result is: 12:00  (Windows server time)  and not  13:00

It seems that FB 5.0 does not take Windows summer time settings.

Conclusion :
How to find the true Os time in FireBird 5.0 (like Firebird 2.5.9)?

THANKS

Carlos H. Cantu

unread,
Aug 18, 2024, 9:18:04 AM8/18/24
to ABAK

Try LOCALTIME instead of CURRENT_TIME?

 

LOCALTIME was introduced in Firebird 3.0.4 and Firebird 2.5.9 as an alias of CURRENT_TIME. In Firebird 4.0, CURRENT_TIME returns a TIME WITH TIME ZONE instead of a TIME [WITHOUT TIME ZONE], while LOCALTIME returns TIME [WITHOUT TIME ZONE]. It is recommended to use LOCALTIME when you do not need time zone information. 


[]s

Carlos

www.firebirdnews.org - www.FireBase.com.br


--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/04b23a20-a953-4f2f-bd6a-52f2556fe633n%40googlegroups.com.

ABAK

unread,
Aug 20, 2024, 5:01:55 AM8/20/24
to firebird-support
Hello Carlos Cantu,

Yes I tried :  Select LocalTime From RDB$DataBase;
Without succes :   it always gives Time Server +1

Explanation :  
My Server Time = 13:00   in Algeria   (Time Zone +01:00 )

Select LocalTime From RDB$DataBase;                  -->  gives 14:00
Also, Select Curent_Time From RDB$DataBase;    -->  gives 14:00

It's logical for FireBird because it will get the time in  Time Zone +01:00
But in Algeria  Summer Time is always deactivated on our Windows Server Setting.
So, the True Time here is 13:00 and not 14:00, despite the Time Zone wich is correct (+01:00)

Conclusion 
It seems that FireBird 5.0   (Firebird-5.0.1.1469-0-windows-x86.exe) 
 does not support OS Summer / Winter  Time.

Fortunately, we found a workarrond  with  SergioMaster  from  

Kindest Regards

Mark Rotteveel

unread,
Aug 20, 2024, 5:30:38 AM8/20/24
to firebird...@googlegroups.com
On 20/08/2024 11:01, ABAK wrote:
> Hello Carlos Cantu,
>
> *Yes I tried :  Select LocalTime From RDB$DataBase;*
> Without succes :   it always gives Time Server +1
>
> *Explanation : *
> My Server Time = 13:00   in Algeria   (Time Zone +01:00 )
> *
> *
> *Select LocalTime From RDB$DataBase;                  -->  gives 14:00*
> *Also, Select Curent_Time From RDB$DataBase;    -->  gives 14:00**
> *
> *
> *
> It's logical for FireBird because it will get the time in  Time Zone +01:00
> *But in Algeria  Summer Time is always deactivated on our Windows Server
> Setting.*
> So, the True Time here is 13:00 and not 14:00, despite the Time Zone
> wich is correct (+01:00)
>
> *Conclusion *
> It seems that FireBird 5.0   (Firebird-5.0.1.1469-0-windows-x86.exe)
> *does not support OS Summer / Winter  Time*.
>
> Fortunately, we found a workarrond  with *SergioMaster *from
> https://www.developpez.net/forums/d2168986/bases-donnees/firebird/sql/
> time-zone-heure-d-ete-firebird-5-0-a/

What is the timezone shown when you do `select CURRENT_TIME from
RDB$DATABASE`?

For example, on my machine it shows `11:29:55.0000 Europe/Amsterdam`

Mark
--
Mark Rotteveel

Dimitry Sibiryakov

unread,
Aug 20, 2024, 5:33:27 AM8/20/24
to firebird...@googlegroups.com
ABAK wrote 20.08.2024 11:01:
> But in Algeria  Summer Time is always deactivated on our Windows Server Setting.

Why? Is it because recent changes in local laws or outdated Windows timezone
information?

--
WBR, SD.

Mark Rotteveel

unread,
Aug 20, 2024, 5:38:34 AM8/20/24
to firebird...@googlegroups.com
Assuming that the timezone Africa/Algiers is configured, the last change
was in May 1981, when it went to summertime (GMT+1) permanently.

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
Aug 20, 2024, 5:41:56 AM8/20/24
to firebird...@googlegroups.com
Ugh, the formatting of RDB$TRANSITIONS in ISQL confused me, they went to
wintertime permanently (GMT+1).

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
Aug 20, 2024, 5:50:00 AM8/20/24
to firebird...@googlegroups.com
On 20/08/2024 11:01, ABAK wrote:
> *Yes I tried :  Select LocalTime From RDB$DataBase;*
> Without succes :   it always gives Time Server +1
>
> *Explanation : *
> My Server Time = 13:00   in Algeria   (Time Zone +01:00 )
> *
> *
> *Select LocalTime From RDB$DataBase;                  -->  gives 14:00*
> *Also, Select Curent_Time From RDB$DataBase;    -->  gives 14:00**
> *
> *
> *
> It's logical for FireBird because it will get the time in  Time Zone +01:00
> *But in Algeria  Summer Time is always deactivated on our Windows Server
> Setting.*

What do you mean with "Summer Time is always deactivated on our Windows
Server settings"? If you configure the right time zone in Windows, then
that is all you should need to do. There should be no deactivating of
summer time, because that is governed by the choice of the right time zone.

It sounds like you selected a different timezone than Africa/Algiers,
and that one does have summer time, and then you somehow worked around that?

When I checked my Windows settings, I didn't see a timezone mentioned
which lists Algiers, but according to
https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11,
the correct timezone would be the "West Central Africa" time zone.

I guess you selected the "Amsterdam, Berlin, Bern, Rome, Stockholm,
Vienna" timezone instead.

> So, the True Time here is 13:00 and not 14:00, despite the Time Zone
> wich is correct (+01:00)
>
> *Conclusion *
> It seems that FireBird 5.0   (Firebird-5.0.1.1469-0-windows-x86.exe)
> *does not support OS Summer / Winter  Time*.

That is not how it works though (or at least, not how it should work).

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
Aug 20, 2024, 5:55:31 AM8/20/24
to firebird...@googlegroups.com
I just selected the West Central Africa timezone as suggested by
Microsoft, and `select CURRENT_TIME from RDB$DATABASE` reported the
right time (with time zone Africa/Lagos).

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
Aug 20, 2024, 6:02:17 AM8/20/24
to firebird...@googlegroups.com
In short, either configure Windows to use the "right" timezone (West
Central Africa) as suggested by Microsoft.

Alternatives are to configure the `DefaultTimeZone` setting in
firebird.conf to either: `Africa/Algiers` or `+01:00`.

Mark
--
Mark Rotteveel

ABAK

unread,
Aug 20, 2024, 10:36:31 AM8/20/24
to firebird-support
Thanks to all of you.

You, all quickly understood the "problem" and, at the same time, you all solved it.
Sorry for any disturbance.

@Mark
You are right :  I am not using the good setting on my Windows TimeZone suggested by Microsoft for Algiers
I am using :  (UTC+01:00) Bruxelles, Copenhague, Madrid, Paris
and :  select CURRENT_TIME from RDB$DATABASE     gives me  ->   15:58:10.0000 Europe/Paris

So I understand now; obviously, firebird gives actual Time at Paris (UTC+02:00 as it is summer time now in France).

And when I Select for Algeria :    (UTC +01:00) West Central Africa   all is OK

But a question remains : 
How does FireBird know the True time with Summer and Winter Time (let say for France) ?
Does French Peaple juste set their Windows Server Time Zone :  (UTC+01:00) Bruxelles, Copenhague, Madrid, Paris
and that is all they should need to do ?
That means data dates for transition summer and winter are stored somewhere ?

Thx

Dimitry Sibiryakov

unread,
Aug 20, 2024, 10:41:53 AM8/20/24
to firebird...@googlegroups.com
ABAK wrote 20.08.2024 16:36:
> That means data dates for transition *summer and winter are stored somewhere* ?

Yes, both Windows and ICU has timezone transition database and update it
regularly. Firebird uses ICU one.

--
WBR, SD.

ABAK

unread,
Aug 20, 2024, 12:08:09 PM8/20/24
to firebird-support
@sd
Thx again :))

Mark Rotteveel

unread,
Aug 20, 2024, 12:10:24 PM8/20/24
to firebird...@googlegroups.com
On 20/08/2024 16:36, ABAK wrote:
> *Thanks to all of you.*
>
> You, all quickly understood the "problem" and, at the same time, you all
> solved it.
> Sorry for any disturbance.
>
> *@Mark*
> You are right :  I am not using the good setting on my Windows TimeZone
> suggested by Microsoft for Algiers
> *I am using :  (UTC+01:00) Bruxelles, Copenhague, Madrid, Paris*
> and :  select CURRENT_TIME from RDB$DATABASE     gives me  ->
>  15:58:10.0000 Europe/Paris
>
> So I understand now; obviously, firebird gives actual Time at Paris
> (UTC+02:00 *as it is summer time now in France*).
> *
> *
> *And when I Select for Algeria :    (UTC +01:00) West Central Africa
>  all is OK*
>
> *But a question remains : *
> How does FireBird know the True time with Summer and Winter Time (let
> say for France) ?
> Does French Peaple juste set their Windows Server Time Zone :
> (UTC+01:00) Bruxelles, Copenhague, Madrid, Paris
> and that is all they should need to do ?
> That means data dates for transition *summer and winter are stored
> somewhere* ?

Yes, Firebird uses the ICU library for that. I'm not exactly sure how
the translation is made from the Windows timezone configuration to the
ICU timezone, but I guess we use a standard feature from ICU for that.
After that translation is done, Firebird uses the timezone information
through the ICU library to determine the time from the current UTC time
reported by the OS.

You can see the transitions of a particular timezone through the
RDB$TIME_ZONE_UTIL.TRANSITIONS stored procedure[1], and the version of
the timezone database using the RDB$TIME_ZONE_UTIL.DATABASE_VERSION
function[2].

PS It's Firebird, not FireBird.

[1]:
https://firebirdsql.org/file/documentation/html/en/refdocs/fblangref50/firebird-50-language-reference.html#fblangref50-sys-pckg-tz-transitions
[2]:
https://firebirdsql.org/file/documentation/html/en/refdocs/fblangref50/firebird-50-language-reference.html#fblangref50-sys-pckg-tz-dbversion

--
Mark Rotteveel

ABAK

unread,
Aug 21, 2024, 12:48:57 PM8/21/24
to firebird-support
 @Mark
Thank you


Reply all
Reply to author
Forward
0 new messages