Skip to content

Commit 0a2ca85

Browse files
author
Jesse Seldess
authored
Merge pull request cockroachdb#3255 from cockroachdb/timetz-fix
TIMETZ is not recommended for use in current state
2 parents de8b26b + 48bb980 commit 0a2ca85

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

v2.1/data-types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Type | Description | Example
2424
[`SERIAL`](serial.html) | A unique 64-bit signed integer. | `148591304110702593 `
2525
[`STRING`](string.html) | A string of Unicode characters. | `'a1b2c3'`
2626
[`TIME`](time.html) | A time of day in UTC. | `TIME '01:23:45.123456'`
27-
[`TIMETZ`](time.html) | <span class="version-tag">New in v2.1:</span> A time of day with a time zone offset from UTC. | `TIMETZ '01:23:45.123456-5:00'`
27+
[`TIMETZ`](time.html) | A time of day with a time zone offset from UTC. **Not recommended for use at this time. For details, see [`TIMETZ`](time.html#timetz-warning).** | `TIMETZ '01:23:45.123456-5:00'`
2828
[`TIMESTAMP`](timestamp.html) | A date and time pairing in UTC. | `TIMESTAMP '2016-01-25 10:10:10'`
2929
[`TIMESTAMPTZ`](timestamp.html) | A date and time pairing with a time zone offset from UTC. | `TIMESTAMPTZ '2016-01-25 10:10:10-05:00'`
3030
[`UUID`](uuid.html) | A 128-bit hexadecimal value. | `7f9c24e8-3b12-4fef-91e0-56a2d5a246ec`

v2.1/time.md

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ The `TIME` [data type](data-types.html) stores the time of day in UTC, whereas `
1515

1616
- `TIMETZ` converts `TIME` values from UTC to the client's session time zone (unless another time zone is specified for the value). However, it is conceptually important to note that `TIMETZ` **does not** store any time zone data.
1717

18+
<a name="timetz-warning"></a>
19+
20+
{{site.data.alerts.callout_danger}}
21+
Use of `TIMETZ` is not recommended at this time. The current implementation is incomplete. The feature will be retracted or corrected in a future release. If corrected, the fix will be backwards-incompatible. For details, see [cockroachdb#25224](https://github.com/cockroachdb/cockroach/issues/25224).
22+
{{site.data.alerts.end}}
23+
1824
{{site.data.alerts.callout_info}}The default session time zone is UTC, which means that by default <code>TIMETZ</code> values display in UTC.{{site.data.alerts.end}}
1925

2026
The difference between these two variants is that `TIMETZ` uses the client's session time zone, while `TIME` does not. This behavior extends to [functions like `now()` and `extract()`](functions-and-operators.html#date-and-time-functions) on `TIMETZ` values.

0 commit comments

Comments
 (0)