Warning
SingleStore 9.0 gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 8.9 is recommended for production workloads, which can later be upgraded to SingleStore 9.0.
TIMESTAMP
On this page
Convert 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
-
TIMESTAMP
is based on UTC timezones. -
SingleStore converts
TIMESTAMP
values 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 setTIMESTAMP
to its minimum value (1970-01-01 00:00:01
), the query will insert0000-00-00 00:00:00
. -
The
TIMESTAMP
function supports improved segment elimination when used inWHERE
clauses.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: March 21, 2025