@@ -1311,8 +1311,8 @@ regexp_replace(str, regexp, replacement, flags)
13111311- [ date_part] ( #date_part )
13121312- [ datepart] ( #datepart )
13131313- [ extract] ( #extract )
1314- - [ to_timestamp] ( #to_timestamp )
13151314- [ today] ( #today )
1315+ - [ to_timestamp] ( #to_timestamp )
13161316- [ to_timestamp_millis] ( #to_timestamp_millis )
13171317- [ to_timestamp_micros] ( #to_timestamp_micros )
13181318- [ to_timestamp_seconds] ( #to_timestamp_seconds )
@@ -1526,6 +1526,27 @@ to_timestamp(expression[, ..., format_n])
15261526
15271527[ chrono format ] : https://docs.rs/chrono/latest/chrono/format/strftime/index.html
15281528
1529+ #### Example
1530+
1531+ ```
1532+ ❯ select to_timestamp('2023-01-31T09:26:56.123456789-05:00');
1533+ +-----------------------------------------------------------+
1534+ | to_timestamp(Utf8("2023-01-31T09:26:56.123456789-05:00")) |
1535+ +-----------------------------------------------------------+
1536+ | 2023-01-31T14:26:56.123456789 |
1537+ +-----------------------------------------------------------+
1538+ ❯ select to_timestamp('03:59:00.123456789 05-17-2023', '%c', '%+', '%H:%M:%S%.f %m-%d-%Y');
1539+ +--------------------------------------------------------------------------------------------------------+
1540+ | to_timestamp(Utf8("03:59:00.123456789 05-17-2023"),Utf8("%c"),Utf8("%+"),Utf8("%H:%M:%S%.f %m-%d-%Y")) |
1541+ +--------------------------------------------------------------------------------------------------------+
1542+ | 2023-05-17T03:59:00.123456789 |
1543+ +--------------------------------------------------------------------------------------------------------+
1544+ ```
1545+
1546+ Additional examples can be found [ here]
1547+
1548+ [ here ] : https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/to_timestamp.rs
1549+
15291550### ` to_timestamp_millis `
15301551
15311552Converts a value to a timestamp (` YYYY-MM-DDT00:00:00.000Z ` ).
@@ -1546,6 +1567,27 @@ to_timestamp_millis(expression[, ..., format_n])
15461567 they appear with the first successful one being returned. If none of the formats successfully parse the expression
15471568 an error will be returned.
15481569
1570+ #### Example
1571+
1572+ ```
1573+ ❯ select to_timestamp_millis('2023-01-31T09:26:56.123456789-05:00');
1574+ +------------------------------------------------------------------+
1575+ | to_timestamp_millis(Utf8("2023-01-31T09:26:56.123456789-05:00")) |
1576+ +------------------------------------------------------------------+
1577+ | 2023-01-31T14:26:56.123 |
1578+ +------------------------------------------------------------------+
1579+ ❯ select to_timestamp_millis('03:59:00.123456789 05-17-2023', '%c', '%+', '%H:%M:%S%.f %m-%d-%Y');
1580+ +---------------------------------------------------------------------------------------------------------------+
1581+ | to_timestamp_millis(Utf8("03:59:00.123456789 05-17-2023"),Utf8("%c"),Utf8("%+"),Utf8("%H:%M:%S%.f %m-%d-%Y")) |
1582+ +---------------------------------------------------------------------------------------------------------------+
1583+ | 2023-05-17T03:59:00.123 |
1584+ +---------------------------------------------------------------------------------------------------------------+
1585+ ```
1586+
1587+ Additional examples can be found [ here]
1588+
1589+ [ here ] : https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/to_timestamp.rs
1590+
15491591### ` to_timestamp_micros `
15501592
15511593Converts a value to a timestamp (` YYYY-MM-DDT00:00:00.000000Z ` ).
@@ -1566,6 +1608,27 @@ to_timestamp_micros(expression[, ..., format_n])
15661608 they appear with the first successful one being returned. If none of the formats successfully parse the expression
15671609 an error will be returned.
15681610
1611+ #### Example
1612+
1613+ ```
1614+ ❯ select to_timestamp_micros('2023-01-31T09:26:56.123456789-05:00');
1615+ +------------------------------------------------------------------+
1616+ | to_timestamp_micros(Utf8("2023-01-31T09:26:56.123456789-05:00")) |
1617+ +------------------------------------------------------------------+
1618+ | 2023-01-31T14:26:56.123456 |
1619+ +------------------------------------------------------------------+
1620+ ❯ select to_timestamp_micros('03:59:00.123456789 05-17-2023', '%c', '%+', '%H:%M:%S%.f %m-%d-%Y');
1621+ +---------------------------------------------------------------------------------------------------------------+
1622+ | to_timestamp_micros(Utf8("03:59:00.123456789 05-17-2023"),Utf8("%c"),Utf8("%+"),Utf8("%H:%M:%S%.f %m-%d-%Y")) |
1623+ +---------------------------------------------------------------------------------------------------------------+
1624+ | 2023-05-17T03:59:00.123456 |
1625+ +---------------------------------------------------------------------------------------------------------------+
1626+ ```
1627+
1628+ Additional examples can be found [ here]
1629+
1630+ [ here ] : https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/to_timestamp.rs
1631+
15691632### ` to_timestamp_nanos `
15701633
15711634Converts a value to a timestamp (` YYYY-MM-DDT00:00:00.000000000Z ` ).
@@ -1586,6 +1649,27 @@ to_timestamp_nanos(expression[, ..., format_n])
15861649 they appear with the first successful one being returned. If none of the formats successfully parse the expression
15871650 an error will be returned.
15881651
1652+ #### Example
1653+
1654+ ```
1655+ ❯ select to_timestamp_nanos('2023-01-31T09:26:56.123456789-05:00');
1656+ +-----------------------------------------------------------------+
1657+ | to_timestamp_nanos(Utf8("2023-01-31T09:26:56.123456789-05:00")) |
1658+ +-----------------------------------------------------------------+
1659+ | 2023-01-31T14:26:56.123456789 |
1660+ +-----------------------------------------------------------------+
1661+ ❯ select to_timestamp_nanos('03:59:00.123456789 05-17-2023', '%c', '%+', '%H:%M:%S%.f %m-%d-%Y');
1662+ +--------------------------------------------------------------------------------------------------------------+
1663+ | to_timestamp_nanos(Utf8("03:59:00.123456789 05-17-2023"),Utf8("%c"),Utf8("%+"),Utf8("%H:%M:%S%.f %m-%d-%Y")) |
1664+ +--------------------------------------------------------------------------------------------------------------+
1665+ | 2023-05-17T03:59:00.123456789 |
1666+ +---------------------------------------------------------------------------------------------------------------+
1667+ ```
1668+
1669+ Additional examples can be found [ here]
1670+
1671+ [ here ] : https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/to_timestamp.rs
1672+
15891673### ` to_timestamp_seconds `
15901674
15911675Converts a value to a timestamp (` YYYY-MM-DDT00:00:00.000Z ` ).
@@ -1606,6 +1690,27 @@ to_timestamp_seconds(expression[, ..., format_n])
16061690 they appear with the first successful one being returned. If none of the formats successfully parse the expression
16071691 an error will be returned.
16081692
1693+ #### Example
1694+
1695+ ```
1696+ ❯ select to_timestamp_seconds('2023-01-31T09:26:56.123456789-05:00');
1697+ +-------------------------------------------------------------------+
1698+ | to_timestamp_seconds(Utf8("2023-01-31T09:26:56.123456789-05:00")) |
1699+ +-------------------------------------------------------------------+
1700+ | 2023-01-31T14:26:56 |
1701+ +-------------------------------------------------------------------+
1702+ ❯ select to_timestamp_seconds('03:59:00.123456789 05-17-2023', '%c', '%+', '%H:%M:%S%.f %m-%d-%Y');
1703+ +----------------------------------------------------------------------------------------------------------------+
1704+ | to_timestamp_seconds(Utf8("03:59:00.123456789 05-17-2023"),Utf8("%c"),Utf8("%+"),Utf8("%H:%M:%S%.f %m-%d-%Y")) |
1705+ +----------------------------------------------------------------------------------------------------------------+
1706+ | 2023-05-17T03:59:00 |
1707+ +----------------------------------------------------------------------------------------------------------------+
1708+ ```
1709+
1710+ Additional examples can be found [ here]
1711+
1712+ [ here ] : https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/to_timestamp.rs
1713+
16091714### ` from_unixtime `
16101715
16111716Converts an integer to RFC3339 timestamp format (` YYYY-MM-DDT00:00:00.000000000Z ` ).
0 commit comments