Skip to content

Commit 8de8621

Browse files
authored
minor: doc fixes for timestamp output format (#18315)
Followup some doc fixes missed in #17888
1 parent 195415d commit 8de8621

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
@@ -69,11 +69,11 @@ use datafusion_macros::user_doc;
6969
FROM (
7070
SELECT '2024-04-01T00:00:20Z'::timestamp AT TIME ZONE 'Europe/Brussels' AS time
7171
);
72-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
73-
| time | type | to_local_time | to_local_time_type |
74-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
75-
| 2024-04-01T00:00:20+02:00 | Timestamp(Nanosecond, Some("Europe/Brussels")) | 2024-04-01T00:00:20 | Timestamp(Nanosecond, None) |
76-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
72+
+---------------------------+----------------------------------+---------------------+--------------------+
73+
| time | type | to_local_time | to_local_time_type |
74+
+---------------------------+----------------------------------+---------------------+--------------------+
75+
| 2024-04-01T00:00:20+02:00 | Timestamp(ns, "Europe/Brussels") | 2024-04-01T00:00:20 | Timestamp(ns) |
76+
+---------------------------+----------------------------------+---------------------+--------------------+
7777
7878
# combine `to_local_time()` with `date_bin()` to bin on boundaries in the timezone rather
7979
# 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
@@ -2749,11 +2749,11 @@ to_local_time(expression)
27492749
FROM (
27502750
SELECT '2024-04-01T00:00:20Z'::timestamp AT TIME ZONE 'Europe/Brussels' AS time
27512751
);
2752-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
2753-
| time | type | to_local_time | to_local_time_type |
2754-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
2755-
| 2024-04-01T00:00:20+02:00 | Timestamp(Nanosecond, Some("Europe/Brussels")) | 2024-04-01T00:00:20 | Timestamp(Nanosecond, None) |
2756-
+---------------------------+------------------------------------------------+---------------------+-----------------------------+
2752+
+---------------------------+----------------------------------+---------------------+--------------------+
2753+
| time | type | to_local_time | to_local_time_type |
2754+
+---------------------------+----------------------------------+---------------------+--------------------+
2755+
| 2024-04-01T00:00:20+02:00 | Timestamp(ns, "Europe/Brussels") | 2024-04-01T00:00:20 | Timestamp(ns) |
2756+
+---------------------------+----------------------------------+---------------------+--------------------+
27572757

27582758
# combine `to_local_time()` with `date_bin()` to bin on boundaries in the timezone rather
27592759
# than UTC boundaries
@@ -2777,7 +2777,7 @@ FROM (
27772777

27782778
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.
27792779

2780-
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.
2780+
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.
27812781

27822782
```sql
27832783
to_timestamp(expression[, ..., format_n])

0 commit comments

Comments
 (0)