How to create Timestamp column in MySQL

We will see how we can create timestamp column in MySQL.

Timestamp means to capture the time along with the date. In MySQL we can create the timestamp column using TIMESTAMP datatype.

To create the timestamp column just put the timestamp after column name.

Example of creating Timestamp column in MySQL

create table attendance(empid int(10), login timestamp,logout timestamp);

We have created new table attendance having two column login and logout as timestamp column.

Scroll to Top