mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
DateLUT: simpler, safer and more efficient [#CLICKHOUSE-2]
This commit is contained in:
parent
8367c99720
commit
344d610ef0
@ -56,6 +56,7 @@ DateLUTImpl::DateLUTImpl(const std::string & time_zone_)
|
|||||||
|
|
||||||
cctz::time_zone::absolute_lookup start_of_epoch_lookup = cctz_time_zone.lookup(std::chrono::system_clock::from_time_t(start_of_day));
|
cctz::time_zone::absolute_lookup start_of_epoch_lookup = cctz_time_zone.lookup(std::chrono::system_clock::from_time_t(start_of_day));
|
||||||
offset_at_start_of_epoch = start_of_epoch_lookup.offset;
|
offset_at_start_of_epoch = start_of_epoch_lookup.offset;
|
||||||
|
offset_is_whole_number_of_hours_everytime = true;
|
||||||
|
|
||||||
cctz::civil_day date{1970, 1, 1};
|
cctz::civil_day date{1970, 1, 1};
|
||||||
|
|
||||||
@ -83,6 +84,9 @@ DateLUTImpl::DateLUTImpl(const std::string & time_zone_)
|
|||||||
values.time_at_offset_change = 0;
|
values.time_at_offset_change = 0;
|
||||||
values.amount_of_offset_change = 0;
|
values.amount_of_offset_change = 0;
|
||||||
|
|
||||||
|
if (start_of_day % 3600)
|
||||||
|
offset_is_whole_number_of_hours_everytime = false;
|
||||||
|
|
||||||
/// If UTC offset was changed in previous day.
|
/// If UTC offset was changed in previous day.
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user