Russian translation

This commit is contained in:
Tatiana Kirillova 2021-06-14 20:19:28 +03:00
parent 76bb1a569f
commit 8a94e9610e
2 changed files with 18 additions and 22 deletions

View File

@ -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

View File

@ -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)