11.05.2018 1:27, Adriano dos Santos Fernandes wrote:
On 10/05/2018 18:03, Vlad Khorsun via Firebird-devel wrote:
...
Could you answer my question below ?

   Please, convert to UTC and explain how to do it:

    2010.03.01 04:00 Europe/Moscow,
    2013.03.01 04:00 Europe/Moscow,
    2016.03.01 04:00 Europe/Moscow


-------------
SQL> select
CON>     timestamp '2010-03-01 04:00 Europe/Moscow' t1,
CON>     timestamp '2013-03-01 04:00 Europe/Moscow' t2,
CON>     timestamp '2016-03-01 04:00 Europe/Moscow' t3
CON>   from rdb$database;

T1                              2010-03-01 04:00:00.0000 Europe/Moscow
T2                              2013-03-01 04:00:00.0000 Europe/Moscow
T3                              2016-03-01 04:00:00.0000 Europe/Moscow


SQL> select
CON>     timestamp '2010-03-01 04:00 Europe/Moscow' at time zone 'GMT' x1,
CON>     timestamp '2013-03-01 04:00 Europe/Moscow' at time zone 'GMT' x2,
CON>     timestamp '2016-03-01 04:00 Europe/Moscow' at time zone 'GMT' x3
CON>   from rdb$database;

X1                              2010-03-01 01:00:00.0000 GMT
X2                              2013-03-01 00:00:00.0000 GMT
X3                              2016-03-01 01:00:00.0000 GMT


SQL> select
CON>     extract(timezone_hour from timestamp '2010-03-01 04:00
Europe/Moscow') tzh1,
CON>     extract(timezone_hour from timestamp '2013-03-01 04:00
Europe/Moscow') tzh2,
CON>     extract(timezone_hour from timestamp '2016-03-01 04:00
Europe/Moscow') tzh3
CON>   from rdb$database;

TZH1                            3
TZH2                            4
TZH3                            3
-------------

  Very good, thanks !

Here I show interesting example when DST starts.

Two different GMT dates apparently maps to the same America/Sao_Paulo.

But if you inspect they timezone displacements, they are different.

-------------
SQL> select
CON>     timestamp '2018-02-18 01:00 GMT' at time zone
'America/Sao_Paulo' t1,
CON>     timestamp '2018-02-18 02:00 GMT' at time zone
'America/Sao_Paulo' t2
CON>   from rdb$database;

T1                              2018-02-17 23:00:00.0000 America/Sao_Paulo
T2                              2018-02-17 23:00:00.0000 America/Sao_Paulo


SQL> select
CON>     extract(timezone_hour from timestamp '2018-02-18 01:00 GMT' at
time zone 'America/Sao_Paulo') tzh1,
CON>     extract(timezone_hour from timestamp '2018-02-18 02:00 GMT' at
time zone 'America/Sao_Paulo') tzh2
CON>   from rdb$database;

TZH1                            -2
TZH2                            -3
-------------


Regards,
Vlad

PS It seems i start to understand you - you want to say that rule for
given area (full TZ name ?) describes all possible moments when offset
from UTC is changed. Including DST start\end and changes due to political
reasons. Correct ?


Yes, let's say that rule is defined from UTC to the time zone, and it
say, between UTC moment x and y, tz has a displacement of +/- hh:mm.

Every range (x-y) must define a displacement.

  Good, now it is much more clear (for me, at least).
It there a way to query\extract this ranges and coresponding displacements ?

Regards,
Vlad

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to