@@ -1311,8 +1311,8 @@ regexp_replace(str, regexp, replacement, flags)
1311
1311
- [ date_part] ( #date_part )
1312
1312
- [ datepart] ( #datepart )
1313
1313
- [ extract] ( #extract )
1314
- - [ to_timestamp] ( #to_timestamp )
1315
1314
- [ today] ( #today )
1315
+ - [ to_timestamp] ( #to_timestamp )
1316
1316
- [ to_timestamp_millis] ( #to_timestamp_millis )
1317
1317
- [ to_timestamp_micros] ( #to_timestamp_micros )
1318
1318
- [ to_timestamp_seconds] ( #to_timestamp_seconds )
@@ -1526,6 +1526,27 @@ to_timestamp(expression[, ..., format_n])
1526
1526
1527
1527
[ chrono format ] : https://docs.rs/chrono/latest/chrono/format/strftime/index.html
1528
1528
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
+
1529
1550
### ` to_timestamp_millis `
1530
1551
1531
1552
Converts a value to a timestamp (` YYYY-MM-DDT00:00:00.000Z ` ).
@@ -1546,6 +1567,27 @@ to_timestamp_millis(expression[, ..., format_n])
1546
1567
they appear with the first successful one being returned. If none of the formats successfully parse the expression
1547
1568
an error will be returned.
1548
1569
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
+
1549
1591
### ` to_timestamp_micros `
1550
1592
1551
1593
Converts a value to a timestamp (` YYYY-MM-DDT00:00:00.000000Z ` ).
@@ -1566,6 +1608,27 @@ to_timestamp_micros(expression[, ..., format_n])
1566
1608
they appear with the first successful one being returned. If none of the formats successfully parse the expression
1567
1609
an error will be returned.
1568
1610
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
+
1569
1632
### ` to_timestamp_nanos `
1570
1633
1571
1634
Converts a value to a timestamp (` YYYY-MM-DDT00:00:00.000000000Z ` ).
@@ -1586,6 +1649,27 @@ to_timestamp_nanos(expression[, ..., format_n])
1586
1649
they appear with the first successful one being returned. If none of the formats successfully parse the expression
1587
1650
an error will be returned.
1588
1651
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
+
1589
1673
### ` to_timestamp_seconds `
1590
1674
1591
1675
Converts a value to a timestamp (` YYYY-MM-DDT00:00:00.000Z ` ).
@@ -1606,6 +1690,27 @@ to_timestamp_seconds(expression[, ..., format_n])
1606
1690
they appear with the first successful one being returned. If none of the formats successfully parse the expression
1607
1691
an error will be returned.
1608
1692
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
+
1609
1714
### ` from_unixtime `
1610
1715
1611
1716
Converts an integer to RFC3339 timestamp format (` YYYY-MM-DDT00:00:00.000000000Z ` ).
0 commit comments