**Example**

Query:

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

Result:

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


#include <DataTypes/DataTypeString.h>
#include <DataTypes/DataTypeDate.h>
#include <DataTypes/DataTypeDateTime.h>
#include <DataTypes/DataTypeDateTime64.h>
#include <Columns/ColumnString.h>
#include <Functions/DateTimeTransforms.h>
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionHelpers.h>
#include <Functions/FunctionsConversion.h>
#include <Functions/IFunctionImpl.h>
#include <Functions/castTypeToEither.h>
#include <Functions/extractTimeZoneFromFunctionArguments.h>
#include <IO/WriteHelpers.h>
#include <common/DateLUTImpl.h>
#include <common/find_symbols.h>
#include <Core/DecimalFunctions.h>
#include <type_traits>
namespace DB
{
namespace ErrorCodes
{