On 10/05/2018 18:03, Vlad Khorsun via Firebird-devel wrote:

> 
>   To do it, you need to know TZ (or, offset from UTC) used at
> America/Sao_Paulo
> at given moment, isn't is ? And this offset is also depends on given moment
> itself. And in different moments there could be different offsets.
> Correct ?
> 

Yes.


> 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
-------------


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.


Adriano


------------------------------------------------------------------------------
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