**Example**

Query:

```` sql
SELECT formatDateTime(toDate('2010-01-04'), '%Q')
````

Result:

```` sql
┌─formatDateTime(toDate('2010-01-04'), '%Q')─┐
│ 1                                          │
└────────────────────────────────────────────┘
````


"Illegal column " + arguments[0].column->getName() + " of function " + getName()
                                    + ", must be Integer or DateTime.",
                                ErrorCodes::ILLEGAL_COLUMN);
                        return true;
                    }))
                {
                    if (!((res = executeType<DataTypeDate>(arguments, result_type))
                        || (res = executeType<DataTypeDateTime>(arguments, result_type))
                        || (res = executeType<DataTypeDateTime64>(arguments, result_type))))
                        throw Exception(
                            "Illegal column " + arguments[0].column->getName() + " of function " + getName()
                                + ", must be Integer or DateTime.",
                            ErrorCodes::ILLEGAL_COLUMN);
                }
            }
        }
        else
        {
            if (!((res = executeType<DataTypeDate>(arguments, result_type))
                || (res = executeType<DataTypeDateTime>(arguments, result_type))
                || (res = executeType<DataTypeDateTime64>(arguments, result_type))))
                throw Exception(
                    "Illegal column " + arguments[0].column->getName() + " of function " + getName()
                        + ", must be Date or DateTime.",
                    ErrorCodes::ILLEGAL_COLUMN);
        }
        return res;
    }
    template <typename DataType>
    ColumnPtr executeType(const ColumnsWithTypeAndName & arguments, const DataTypePtr &) const