Skip to content

Commit

Permalink
Update DataTimePart in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
am357 committed Jan 27, 2022
1 parent d5f78bf commit 73c37e2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/user/BuiltInFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ COALESCE(missing, 1) -- 1

### DATE_ADD

Given a data part, a quantity and a timestamp, returns an updated timestamp by altering date part by quantity
Given a data part, a quantity and a timestamp, returns an updated timestamp by altering datetime part by quantity

Signature
: `DATE_ADD: DatePart Integer Timestamp -> Timestamp`
: `DATE_ADD: DateTimePart Integer Timestamp -> Timestamp`

Where `DatePart` is one of
Where `DateTimePart` is one of

* `year`
* `month`
Expand Down Expand Up @@ -327,19 +327,19 @@ DATE_ADD(second, 1, `2017-01-02T03:04:05.006Z`) -- 2017-01-02T03:04:06.006Z

### DATE_DIFF

Given a date part and two valid timestamps returns the difference in date parts.
Given a datetime part and two valid timestamps returns the difference in datetime parts.

Signature
: `DATE_DIFF: DatePart Timestamp Timestamp -> Integer`
: `DATE_DIFF: DateTimePart Timestamp Timestamp -> Integer`

See [DATE_ADD](#date_add) for the definition of `DatePart`
See [DATE_ADD](#date_add) for the definition of `DateTimePart`

Header
: `DATE_DIFF(dp, t1, t2)`


Purpose
: Given a date part `dp` and two timestamps `t1` and `t2` returns the difference in value for `dp` part of `t1` with `t2`.
: Given a datetime part `dp` and two timestamps `t1` and `t2` returns the difference in value for `dp` part of `t1` with `t2`.
The return value is a negative integer when the `dp` value of `t1` is greater than the `dp` value of `t2`, and, a positive
integer when the `dp` value of `t1` is less than the `dp` value of `t2`.

Expand Down Expand Up @@ -392,12 +392,12 @@ EXISTS(missing) -- false

### EXTRACT

Given a date part and a datetime type returns then datetime's date part value.
Given a datetime part and a datetime type returns then datetime's datetime part value.

Signature
: `EXTRACT: ExtractDatePart DateTime -> Integer`
: `EXTRACT: ExtractDateTimePart DateTime -> Integer`

where `ExtractDatePart` is one of
where `ExtractDateTimePart` is one of

* `year`
* `month`
Expand All @@ -414,13 +414,13 @@ and `DateTime` type is one of
* `TIME`
* `TIMESTAMP`

*Note* that `ExtractDatePart` **differs** from `DatePart` in [DATE_ADD](#date_add).
*Note* that `ExtractDateTimePart` **differs** from `DateTimePart` in [DATE_ADD](#date_add).

Header
: `EXTRACT(edp FROM t)`

Purpose
: Given a date part, `edp`, and a datetime type `t` return `t`'s value for `edp`.
: Given a datetime part, `edp`, and a datetime type `t` return `t`'s value for `edp`.
This function allows for `t` to be unknown (`null` or `missing`) but **not** `edp`.
If `t` is unknown the function returns `null`.

Expand Down

0 comments on commit 73c37e2

Please sign in to comment.