```
milovidov-desktop :) SELECT toString(toDateTime('-922337203.6854775808', 1))

SELECT toString(toDateTime('-922337203.6854775808', 1))

Query id: 3d51ba80-4993-4f64-b6ef-da0c0f1bdf43

┌─toString(toDateTime('-922337203.6854775808', 1))─┐
│ 2106-02-07 :rE:�.6                                │
└──────────────────────────────────────────────────┘
```
#pragma once
#include "DayNum.h"
#include "defines.h"
#include "types.h"
#include <ctime>
#include <string>
#define DATE_LUT_MAX (0xFFFFFFFFU - 86400)
#define DATE_LUT_MAX_DAY_NUM (0xFFFFFFFFU / 86400)
#define DATE_LUT_SIZE 0x10000
#define DATE_LUT_MIN_YEAR 1970
#define DATE_LUT_MAX_YEAR 2106 /// Last supported year (incomplete)
#define DATE_LUT_YEARS (1 + DATE_LUT_MAX_YEAR - DATE_LUT_MIN_YEAR) /// Number of years in lookup table
#if defined(__PPC__)
#if !__clang__
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#endif
enum class WeekModeFlag : UInt8
{
    MONDAY_FIRST = 1,
    YEAR = 2,
    FIRST_WEEKDAY = 4,
    NEWYEAR_DAY = 8
};
using YearWeek = std::pair<UInt16, UInt8>;
/** Lookup table to conversion of time to date, and to month / year / day of week / day of month and so on.
  * First time was implemented for OLAPServer, that needed to do billions of such transformations.
  */
class DateLUTImpl