From 8a94e9610ea1bd078d90db879eee6edbac7ca6cc Mon Sep 17 00:00:00 2001 From: Tatiana Kirillova Date: Mon, 14 Jun 2021 20:19:28 +0300 Subject: [PATCH] Russian translation --- docs/en/sql-reference/operators/index.md | 23 +---------------------- docs/ru/sql-reference/operators/index.md | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/docs/en/sql-reference/operators/index.md b/docs/en/sql-reference/operators/index.md index 8afb77cff8b..966a75d9e98 100644 --- a/docs/en/sql-reference/operators/index.md +++ b/docs/en/sql-reference/operators/index.md @@ -191,9 +191,8 @@ SELECT now() AS current_date_time, current_date_time + INTERVAL '4' day + INTERV You can set the period without using `INTERVAL` by multiplying seconds, minutes, and hours. For example, a period of one day can be set at `60*60*24`. !!! note "Note" - Syntax `now() + 60*60*24` doesn't consider time settings. For example, daylight saving time. + Syntax `now() + 60*60*24` doesn't consider time settings. For example, daylight saving time. The `INTERVAL` syntax or `addDays`-function is always preferred. -The `INTERVAL` syntax or `addDays`-function is always preferred. Examples: @@ -207,26 +206,6 @@ SELECT now() AS current_date_time, current_date_time + 60*60*96; └─────────────────────┴─────────────────────────────────────────────┘ ``` -``` sql -SELECT now() AS current_date_time, current_date_time + 60*60*24 + 60*60*2; -``` - -``` text -┌───current_date_time─┬─plus(plus(now(), multiply(multiply(60, 60), 24)), multiply(multiply(60, 60), 2))─┐ -│ 2021-06-12 17:36:30 │ 2021-06-13 19:36:30 │ -└─────────────────────┴──────────────────────────────────────────────────────────────────────────────────┘ -``` - -``` sql -SELECT now() AS current_date_time, current_date_time + 60*23; -``` - -``` text -┌───current_date_time─┬─plus(now(), multiply(60, 23))─┐ -│ 2021-06-12 17:38:02 │ 2021-06-12 18:01:02 │ -└─────────────────────┴───────────────────────────────┘ -``` - **See Also** - [Interval](../../sql-reference/data-types/special-data-types/interval.md) data type diff --git a/docs/ru/sql-reference/operators/index.md b/docs/ru/sql-reference/operators/index.md index b7cacaf7a03..de1c5630255 100644 --- a/docs/ru/sql-reference/operators/index.md +++ b/docs/ru/sql-reference/operators/index.md @@ -189,6 +189,23 @@ SELECT now() AS current_date_time, current_date_time + INTERVAL '4' day + INTERV └─────────────────────┴────────────────────────────────────────────────────────────┘ ``` +Вы можете задать период без использования синтаксиса `INTERVAL`, умножив секунды, минуты и часы. Например, период в один день можно записать как `60*60*24`. + +!!! note "Примечание" + Синтаксис `now() + 60*60*24` не учитывает региональные настройки времени. Например, переход на летнее время. Для работы с интервалами синтаксис `INTERVAL` или функция `addDays` предпочтительней. + +Пример: + +``` sql +SELECT now() AS current_date_time, current_date_time + 60*60*96; +``` + +``` text +┌───current_date_time─┬─plus(now(), multiply(multiply(60, 60), 96))─┐ +│ 2021-06-12 17:34:49 │ 2021-06-16 17:34:49 │ +└─────────────────────┴─────────────────────────────────────────────┘ +``` + **Смотрите также** - Тип данных [Interval](../../sql-reference/operators/index.md)