```
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                                │
└──────────────────────────────────────────────────┘
```
{
        DayNum index = findIndex(t);
        return lut[index - (lut[index].day_of_month - 1)].date;
    }
    inline DayNum toFirstDayNumOfMonth(DayNum d) const
    {
        return DayNum(d - (lut[d].day_of_month - 1));
    }
    inline DayNum toFirstDayNumOfMonth(time_t t) const
    {
        return toFirstDayNumOfMonth(toDayNum(t));
    }
    
    inline DayNum toFirstDayNumOfQuarter(DayNum d) const
    {
        DayNum index = d;
        size_t month_inside_quarter = (lut[index].month - 1) % 3;
        index -= lut[index].day_of_month;
        while (month_inside_quarter)
        {
            index -= lut[index].day_of_month;
            --month_inside_quarter;
        }
        return DayNum(index + 1);
    }
    inline DayNum toFirstDayNumOfQuarter(time_t t) const