Skip to content

Commit b2db7ab

Browse files
Jefffreycodetyri0n
authored andcommitted
minor: doc fixes for timestamp output format (apache#18315)
Followup some doc fixes missed in apache#17888
1 parent 28fb15a commit b2db7ab

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

datafusion/functions/src/datetime/to_local_time.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ use datafusion_macros::user_doc;
6767
FROM (
6868
SELECT '2024-04-01T00:00:20Z'::timestamp AT TIME ZONE 'Europe/Brussels' AS time
6969
);
70-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
71-
| time | type | to_local_time | to_local_time_type |
72-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
73-
| 2024-04-01T00:00:20+02:00 | Timestamp(Nanosecond, Some("Europe/Brussels")) | 2024-04-01T00:00:20 | Timestamp(Nanosecond, None) |
74-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
70+
+---------------------------+----------------------------------+---------------------+--------------------+
71+
| time | type | to_local_time | to_local_time_type |
72+
+---------------------------+----------------------------------+---------------------+--------------------+
73+
| 2024-04-01T00:00:20+02:00 | Timestamp(ns, "Europe/Brussels") | 2024-04-01T00:00:20 | Timestamp(ns) |
74+
+---------------------------+----------------------------------+---------------------+--------------------+
7575
7676
# combine `to_local_time()` with `date_bin()` to bin on boundaries in the timezone rather
7777
# than UTC boundaries

datafusion/functions/src/datetime/to_timestamp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use datafusion_macros::user_doc;
3838
description = r#"
3939
Converts a value to a timestamp (`YYYY-MM-DDT00:00:00Z`). Supports strings, integer, unsigned integer, and double types as input. Strings are parsed as RFC3339 (e.g. '2023-07-20T05:44:00') if no [Chrono formats] are provided. Integers, unsigned integers, and doubles are interpreted as seconds since the unix epoch (`1970-01-01T00:00:00Z`). Returns the corresponding timestamp.
4040
41-
Note: `to_timestamp` returns `Timestamp(Nanosecond)`. The supported range for integer input is between `-9223372037` and `9223372036`. Supported range for string input is between `1677-09-21T00:12:44.0` and `2262-04-11T23:47:16.0`. Please use `to_timestamp_seconds` for the input outside of supported bounds.
41+
Note: `to_timestamp` returns `Timestamp(ns)`. The supported range for integer input is between `-9223372037` and `9223372036`. Supported range for string input is between `1677-09-21T00:12:44.0` and `2262-04-11T23:47:16.0`. Please use `to_timestamp_seconds` for the input outside of supported bounds.
4242
"#,
4343
syntax_example = "to_timestamp(expression[, ..., format_n])",
4444
sql_example = r#"```sql

docs/source/user-guide/sql/scalar_functions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,11 +2780,11 @@ to_local_time(expression)
27802780
FROM (
27812781
SELECT '2024-04-01T00:00:20Z'::timestamp AT TIME ZONE 'Europe/Brussels' AS time
27822782
);
2783-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
2784-
| time | type | to_local_time | to_local_time_type |
2785-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
2786-
| 2024-04-01T00:00:20+02:00 | Timestamp(Nanosecond, Some("Europe/Brussels")) | 2024-04-01T00:00:20 | Timestamp(Nanosecond, None) |
2787-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
2783+
+---------------------------+----------------------------------+---------------------+--------------------+
2784+
| time | type | to_local_time | to_local_time_type |
2785+
+---------------------------+----------------------------------+---------------------+--------------------+
2786+
| 2024-04-01T00:00:20+02:00 | Timestamp(ns, "Europe/Brussels") | 2024-04-01T00:00:20 | Timestamp(ns) |
2787+
+---------------------------+----------------------------------+---------------------+--------------------+
27882788

27892789
# combine `to_local_time()` with `date_bin()` to bin on boundaries in the timezone rather
27902790
# than UTC boundaries
@@ -2808,7 +2808,7 @@ FROM (
28082808

28092809
Converts a value to a timestamp (`YYYY-MM-DDT00:00:00Z`). Supports strings, integer, unsigned integer, and double types as input. Strings are parsed as RFC3339 (e.g. '2023-07-20T05:44:00') if no [Chrono formats] are provided. Integers, unsigned integers, and doubles are interpreted as seconds since the unix epoch (`1970-01-01T00:00:00Z`). Returns the corresponding timestamp.
28102810

2811-
Note: `to_timestamp` returns `Timestamp(Nanosecond)`. The supported range for integer input is between `-9223372037` and `9223372036`. Supported range for string input is between `1677-09-21T00:12:44.0` and `2262-04-11T23:47:16.0`. Please use `to_timestamp_seconds` for the input outside of supported bounds.
2811+
Note: `to_timestamp` returns `Timestamp(ns)`. The supported range for integer input is between `-9223372037` and `9223372036`. Supported range for string input is between `1677-09-21T00:12:44.0` and `2262-04-11T23:47:16.0`. Please use `to_timestamp_seconds` for the input outside of supported bounds.
28122812

28132813
```sql
28142814
to_timestamp(expression[, ..., format_n])

0 commit comments

Comments
 (0)