You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns the current time as a value in 'YYYY-MM-DD'.
967
+
CURDATE() returns the time at which it executes as `SYSDATE() <#sysdate>`_ does.
968
+
969
+
Return type: DATE
970
+
971
+
Specification: CURDATE() -> DATE
972
+
973
+
Example::
974
+
975
+
> SELECT CURDATE();
976
+
fetched rows / total rows = 1/1
977
+
+-------------+
978
+
| CURDATE() |
979
+
|-------------|
980
+
| 2022-08-02 |
981
+
+-------------+
982
+
983
+
984
+
CURRENT_DATE
985
+
------------
986
+
987
+
Description
988
+
>>>>>>>>>>>
989
+
990
+
`CURRENT_DATE` and `CURRENT_DATE()` are synonyms for `CURDATE() <#curdate>`_.
991
+
992
+
Example::
993
+
994
+
> SELECT CURRENT_DATE(), CURRENT_DATE;
995
+
fetched rows / total rows = 1/1
996
+
+------------------+----------------+
997
+
| CURRENT_DATE() | CURRENT_DATE |
998
+
|------------------+----------------|
999
+
| 2022-08-02 | 2022-08-02 |
1000
+
+------------------+----------------+
1001
+
1002
+
1003
+
CURRENT_TIME
1004
+
------------
1005
+
1006
+
Description
1007
+
>>>>>>>>>>>
1008
+
1009
+
`CURRENT_TIME` and `CURRENT_TIME()` are synonyms for `CURTIME() <#curtime>`_.
1010
+
1011
+
Example::
1012
+
1013
+
> SELECT CURRENT_TIME(), CURRENT_TIME;
1014
+
fetched rows / total rows = 1/1
1015
+
+-----------------+----------------+
1016
+
| CURRENT_TIME() | CURRENT_TIME |
1017
+
|-----------------+----------------|
1018
+
| 15:39:05 | 15:39:05 |
1019
+
+-----------------+----------------+
1020
+
1021
+
1022
+
CURRENT_TIMESTAMP
1023
+
-----------------
1024
+
1025
+
Description
1026
+
>>>>>>>>>>>
1027
+
1028
+
`CURRENT_TIMESTAMP` and `CURRENT_TIMESTAMP()` are synonyms for `NOW() <#now>`_.
1029
+
1030
+
Example::
1031
+
1032
+
> SELECT CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP;
1033
+
fetched rows / total rows = 1/1
1034
+
+-----------------------+---------------------+
1035
+
| CURRENT_TIMESTAMP() | CURRENT_TIMESTAMP |
1036
+
|-----------------------+---------------------|
1037
+
| 2022-08-02 15:54:19 | 2022-08-02 15:54:19 |
1038
+
+-----------------------+---------------------+
1039
+
1040
+
1041
+
CURTIME
1042
+
-------
1043
+
1044
+
Description
1045
+
>>>>>>>>>>>
967
1046
968
-
1. CURDATE() -> DATE
1047
+
Returns the current time as a value in 'hh:mm:ss'.
1048
+
CURTIME() returns the time at which the statement began to execute as `NOW() <#now>`_ does.
1049
+
1050
+
Return type: TIME
1051
+
1052
+
Specification: CURTIME() -> TIME
1053
+
1054
+
Example::
1055
+
1056
+
> SELECT CURTIME() as value_1, CURTIME() as value_2;
1057
+
fetched rows / total rows = 1/1
1058
+
+-----------+-----------+
1059
+
| value_1 | value_2 |
1060
+
|-----------+-----------|
1061
+
| 15:39:05 | 15:39:05 |
1062
+
+-----------+-----------+
969
1063
970
1064
971
1065
DATE
@@ -1448,6 +1542,44 @@ Example::
1448
1542
+---------------------------+
1449
1543
1450
1544
1545
+
LOCALTIMESTAMP
1546
+
--------------
1547
+
1548
+
Description
1549
+
>>>>>>>>>>>
1550
+
1551
+
`LOCALTIMESTAMP` and `LOCALTIMESTAMP()` are synonyms for `NOW() <#now>`_.
1552
+
1553
+
Example::
1554
+
1555
+
> SELECT LOCALTIMESTAMP(), LOCALTIMESTAMP;
1556
+
fetched rows / total rows = 1/1
1557
+
+---------------------+---------------------+
1558
+
| LOCALTIMESTAMP() | LOCALTIMESTAMP |
1559
+
|---------------------+---------------------|
1560
+
| 2022-08-02 15:54:19 | 2022-08-02 15:54:19 |
1561
+
+---------------------+---------------------+
1562
+
1563
+
1564
+
LOCALTIME
1565
+
---------
1566
+
1567
+
Description
1568
+
>>>>>>>>>>>
1569
+
1570
+
`LOCALTIME` and `LOCALTIME()` are synonyms for `NOW() <#now>`_.
1571
+
1572
+
Example::
1573
+
1574
+
> SELECT LOCALTIME(), LOCALTIME;
1575
+
fetched rows / total rows = 1/1
1576
+
+---------------------+---------------------+
1577
+
| LOCALTIME() | LOCALTIME |
1578
+
|---------------------+---------------------|
1579
+
| 2022-08-02 15:54:19 | 2022-08-02 15:54:19 |
1580
+
+---------------------+---------------------+
1581
+
1582
+
1451
1583
MAKEDATE
1452
1584
--------
1453
1585
@@ -1612,7 +1744,7 @@ NOW
1612
1744
Description
1613
1745
>>>>>>>>>>>
1614
1746
1615
-
Returns the current date and time as a value in 'YYYY-MM-DD hh:mm:ss.nnnnnn' format. The value is expressed in the cluster time zone.
1747
+
Returns the current date and time as a value in 'YYYY-MM-DD hh:mm:ss' format. The value is expressed in the cluster time zone.
1616
1748
`NOW()` returns a constant time that indicates the time at which the statement began to execute. This differs from the behavior for `SYSDATE() <#sysdate>`_, which returns the exact time at which it executes.
Returns the current date and time as a value in 'YYYY-MM-DD hh:mm:ss.nnnnnn'.
1697
-
SYSDATE() returns the time at which it executes. This differs from the behavior for `NOW() <#now>`_, which returns a constant time that indicates the time at which the statement began to execute.
1698
-
1699
-
Return type: DATETIME
1700
-
1701
-
Specification: SYSDATE() -> DATETIME
1702
-
1703
-
Example::
1704
-
1705
-
> SELECT SYSDATE() as value_1, SYSDATE() as value_2;
Returns the current date and time as a value in 'YYYY-MM-DD hh:mm:ss[.nnnnnn]'.
1849
+
SYSDATE() returns the time at which it executes. This differs from the behavior for `NOW() <#now>`_, which returns a constant time that indicates the time at which the statement began to execute.
1850
+
If the argument is given, it specifies a fractional seconds precision from 0 to 6, the return value includes a fractional seconds part of that many digits.
1851
+
1852
+
Optional argument type: INTEGER
1853
+
1854
+
Return type: DATETIME
1855
+
1856
+
Specification: SYSDATE([INTEGER]) -> DATETIME
1857
+
1858
+
Example::
1859
+
1860
+
> SELECT SYSDATE() as value_1, SYSDATE(6) as value_2;
0 commit comments