mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
dbms: fixed error with formatting DateTime near begin of unix epoch; fixed error with toTime function when changing daylight saving time; fixed toTime function for non-Moscow time zones [#CONV-7755].
This commit is contained in:
parent
2698537c59
commit
3673752d1b
@ -119,7 +119,7 @@ struct ToStartOfYearImpl
|
||||
struct ToTimeImpl
|
||||
{
|
||||
/// При переводе во время, дату будем приравнивать к 1970-01-02.
|
||||
static inline UInt32 execute(UInt32 t, Yandex::DateLUTSingleton & date_lut) { return t - date_lut.toDate(t) + 75600; }
|
||||
static inline UInt32 execute(UInt32 t, Yandex::DateLUTSingleton & date_lut) { return date_lut.toTimeInaccurate(t) + 86400; }
|
||||
static inline UInt32 execute(UInt16 d, Yandex::DateLUTSingleton & date_lut)
|
||||
{
|
||||
throw Exception("Illegal type Date of argument for function toTime", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
||||
|
@ -40,5 +40,7 @@ namespace Yandex
|
||||
if (lut[day].month == 1 && lut[day].day_of_month == 1)
|
||||
years_lut[lut[day].year - DATE_LUT_MIN_YEAR] = day;
|
||||
}
|
||||
|
||||
offset_at_start_of_epoch = 86400 - lut[findIndex(86400)].date;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user