mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
22 lines
805 B
MySQL
22 lines
805 B
MySQL
|
-- Appeared in https://github.com/ClickHouse/ClickHouse/pull/26978#issuecomment-890889362
|
||
|
WITH toDateTime('1970-06-17 07:39:21', 'Africa/Monrovia') as t
|
||
|
SELECT toUnixTimestamp(t),
|
||
|
timeZoneOffset(t),
|
||
|
formatDateTime(t, '%F %T', 'Africa/Monrovia'),
|
||
|
toString(t, 'Africa/Monrovia'),
|
||
|
toStartOfMinute(t),
|
||
|
toStartOfFiveMinute(t),
|
||
|
toStartOfFifteenMinutes(t),
|
||
|
toStartOfTenMinutes(t),
|
||
|
toStartOfHour(t),
|
||
|
toStartOfDay(t),
|
||
|
toStartOfWeek(t),
|
||
|
toStartOfInterval(t, INTERVAL 1 second),
|
||
|
toStartOfInterval(t, INTERVAL 1 minute),
|
||
|
toStartOfInterval(t, INTERVAL 2 minute),
|
||
|
toStartOfInterval(t, INTERVAL 5 minute),
|
||
|
toStartOfInterval(t, INTERVAL 60 minute),
|
||
|
addMinutes(t, 1),
|
||
|
addMinutes(t, 60)
|
||
|
FORMAT Vertical;
|