EN
MySQL - TIMESTEMP() function example
0 points
In this article, we would like to show you TIMESTAMP()
function example in MySQL.
Quick solution:
xxxxxxxxxx
1
TIMESTAMP(expression);
or
xxxxxxxxxx
1
TIMESTAMP(expression1, expression2);
Where:
- expression -
DATE
orDATETIME
value, - expression1 -
DATE
orDATETIME
value, - expression2 -
TIME
value.
In this example, we will display the timestamp value for the given DATE
expression 2021-04-27
.
Query:
xxxxxxxxxx
1
SELECT TIMESTAMP('2021-04-27');
Result:

In this example, we will display the timestamp value for the given DATETIME
expression 2021-04-27 19:20:00
.
Query:
xxxxxxxxxx
1
SELECT TIMESTAMP('2021-04-27 19:20:00');
Result:

In this example, we will display the timestamp value for the given DATE
and TIME
expressions 2021-04-27
and 19:20:00
.
Query:
xxxxxxxxxx
1
SELECT TIMESTAMP('2021-04-27', '19:20:00');
Result:
