Skip to content

Commit

Permalink
chore(docs): minor clean up in date-time function docs
Browse files Browse the repository at this point in the history
  • Loading branch information
puzpuzpuz committed Dec 13, 2024
1 parent 44377c2 commit 0f24f5a
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions documentation/reference/function/date-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ our [Date to Timestamp conversion](/docs/clients/date-to-timestamp-conversion) r
## date_trunc

`date_trunc(unit, timestamp)` - returns a timestamp truncated to the specified
precision
precision.

**Arguments:**

Expand All @@ -113,9 +113,8 @@ precision
- `hour`
- `minute`
- `second`
- `milliseconds`
- `microseconds`
<!--https://github.com/questdb/questdb/pull/3158-->
- `millisecond`
- `microsecond`

- `timestamp` is any timestamp value.

Expand Down Expand Up @@ -273,7 +272,7 @@ SELECT day(ts), count() FROM transactions;
## day_of_week

`day_of_week(value)` - returns the day number in a week from `1` (Monday) to `7`
(Sunday)
(Sunday).

**Arguments:**

Expand Down Expand Up @@ -302,7 +301,7 @@ SELECT to_str(ts,'EE'),day_of_week(ts) FROM myTable;
## day_of_week_sunday_first

`day_of_week_sunday_first(value)` - returns the day number in a week from `1`
(Sunday) to `7` (Saturday)
(Sunday) to `7` (Saturday).

**Arguments:**

Expand Down Expand Up @@ -357,7 +356,7 @@ SELECT month(ts), days_in_month(ts) FROM myTable;

## extract

`extract (unit, timestamp)` - returns the selected time unit from the input
`extract(unit, timestamp)` - returns the selected time unit from the input
timestamp.

**Arguments:**
Expand Down Expand Up @@ -404,11 +403,10 @@ extract(second from '2023-03-11T22:00:30.555555Z') second;
| millennium | year | month | quarter | hour | second |
| ---------- | ---- | ----- | ------- | ---- | ------ |
| 3 | 2023 | 3 | 10 | 22 | 30 |
| | | | | | |

## hour

`hour(value)` - returns the `hour` of day for a given timestamp from `0` to `23`
`hour(value)` - returns the `hour` of day for a given timestamp from `0` to `23`.

**Arguments:**

Expand Down Expand Up @@ -548,7 +546,7 @@ limit -1;
## micros

`micros(value)` - returns the `micros` of the millisecond for a given date or
timestamp from `0` to `999`
timestamp from `0` to `999`.

**Arguments:**

Expand Down Expand Up @@ -593,7 +591,7 @@ SELECT micros(ts), count() FROM transactions;
## millis

`millis(value)` - returns the `millis` of the second for a given date or
timestamp from `0` to `999`
timestamp from `0` to `999`.

**Arguments:**

Expand Down Expand Up @@ -639,7 +637,7 @@ SELECT millis(ts), count() FROM transactions;
## minute

`minute(value)` - returns the `minute` of the hour for a given timestamp from
`0` to `59`
`0` to `59`.

**Arguments:**

Expand Down Expand Up @@ -675,7 +673,7 @@ SELECT minute(ts), count() FROM transactions;

## month

`month(value)` - returns the `month` of year for a given date from `1` to `12`
`month(value)` - returns the `month` of year for a given date from `1` to `12`.

**Arguments:**

Expand Down Expand Up @@ -781,7 +779,7 @@ SELECT pg_postmaster_start_time();
## second

`second(value)` - returns the `second` of the minute for a given date or
timestamp from `0` to `59`
timestamp from `0` to `59`.

**Arguments:**

Expand Down Expand Up @@ -1178,7 +1176,7 @@ values(to_date('2019-12-12T12:15', 'yyyy-MM-ddTHH:mm'), 123.5);
## to_str

`to_str(value, format)` - converts timestamp value to a string in the specified
format
format.

Will convert a timestamp value to a string using the format definition passed as
an argument. When elements in the `format` definition are unrecognized, they
Expand Down Expand Up @@ -1388,7 +1386,7 @@ SELECT to_utc('2021-06-08T13:45:45.000000Z', 'PST')
## week_of_year

`week_of_year(value)` - returns the number representing the week number in the
year
year.

**Arguments:**

Expand Down

0 comments on commit 0f24f5a

Please sign in to comment.