When a DST day has 82800 seconds, why half a day is 43600?

Viewed 73

I have next two queries to calculate a day and a half of day

tucha=> select extract( epoch from '2019-03-31'::timestamptz +interval '1day' - '2019-03-31'::timestamptz );
 date_part 
-----------
     82800
(1 row)

tucha=> select extract( epoch from '2019-03-31'::timestamptz +interval '0.5day' - '2019-03-31'::timestamptz );
 date_part 
-----------
     43200
(1 row)

if one day is 82800, then a half a day should be 41400, is not?

tucha=> select extract( epoch from '2019-04-01'::timestamptz -'2019-03-31'::timestamptz )/2;
 ?column? 
----------
    41400
(1 row)

NOTICE postgresql actually calculate 43200, but I expect 41400 as it calculated for last expression

NOTICE both: 1day and 0.5day periods contain time when DST occur

UPD
Is there a spec about how half a day is calculated for days when DST occur?

0 Answers
Related