Important
The SingleStore 9.1 release candidate (RC) is available now. It will be promoted to general availability (GA) soon and at that time it will be renamed to SingleStore 10.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10, while SingleStore 9.0 is recommended for production workloads.
TIMESTAMP
On this page
The TIMESTAMP() function converts the input argument to a datetime object.
Syntax
TIMESTAMP(dateobj)Arguments
-
dateobj: a valid date, datetime, or parsable date string.
Return Type
Datetime object.
Remarks
-
TIMESTAMPis based on UTC timezones. -
SingleStore converts
TIMESTAMPvalues from the current timezone to UTC for storage. -
Minimum value: when setting a value for
TIMESTAMP, if your UTC timezone is before UTC (set to UTC +<hours>) and you setTIMESTAMPto its minimum value (1970-01-01 00:00:01), the query will insert0000-00-00 00:00:00. -
The
TIMESTAMPfunction supports improved segment elimination when used inWHEREclauses.See the following query example: SELECT ... FROM table_name WHERE TIMESTAMP(column_name) > '2000-01-01 00:00:00' AND TIMESTAMP(column_name) <= '2015-03-03 00:00:00';
Examples
SELECT TIMESTAMP('2015-03-03');
+-------------------------+
| TIMESTAMP('2015-03-03') |
+-------------------------+
| 2015-03-03 00:00:00 |
+-------------------------+Related Topics
Last modified: