Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
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”);