Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

TIMESTAMP

Example

Generate a datetime value from the provided arguments.

SELECT TIMESTAMP(“2017-07-23”,  “13:10:11”);

Definition and Usage

The TIMESTAMP() function produces a datetime value from a given date or datetime input.

Note: If two arguments are provided, the function first adds the second argument to the first and then returns a datetime value.

Syntax

TIMESTAMP(expressiontime)

Parameter Values

Parameter

Description

expression

Required: A value representing a date or datetime.

time

Optional: A time value to be added to the expression.

Technical Details

Works in:

 From MySQL version 4.0

More Examples

Example

Generate a datetime value using the provided arguments.

SELECT TIMESTAMP(“2017-07-23”);