On 05/06/18 09:39, Mark Rotteveel wrote:
On 5-6-2018 10:16, Lester Caine wrote:
On 05/06/18 08:50, Mark Rotteveel wrote:
That naming doesn't make much sense to me, and I actually found the
RULE_START and RULE_END naming pretty clear and self-explanatory.
Except that it's not the rule itself, but the transitions within the
rule ... I'd still like to know why there is a need for the 'end'
anyway as the next transition already contains that.
Because that is easier when doing queries... select * from ... where
current_timestamp between rule_start and rule_end.
But you have to use 'current_timestamp' to find the 'rule_start' and
'rule_end' and for many timezones 'rule_end' will simply be the current
generic end date returned by the tz database. It requires a little bit
more processing than simply pulling out two numbers for a single
transition. You normally need the data from the next transition in any
case. Your example would be much better as
select * from ... where date between tzoffset(tz, date, current_start)
and tzoffset(tz, date, next_start)
And we can also have tzoffset(tz, date, current) and tzoffset(tz, date,
next )
And I've still not had anybody explain why the removal of seconds from
the offsets is seen as a good idea?
Why is it a bad idea?
Because the first transition of every rule set is from LMT to a standard
time of some sort. All normalizations to UTC time prior to various times
in the last 200 years involve a seconds based correction. SO if one is
doing any historic work, one has to ditch many current methods ...
because they only work from 1970 ... and do things a different way. At
the very least, the documentation has to SAY when the built in
procedures can be relied on, and when one has to ditch them. At the same
time adding the fact the dates are all Gregorian would be useful.
Knowing that historic changes TO Gregorian dates need special treatment
would be useful ... I only learnt that Russia was still on the Julian
calendar until the early 1900's this week ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
------------------------------------------------------------------------------
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