I am trying to create a table that has date and time columns used to store the date and time information when the entry is recorded in the database. In the MySQL documentati
There is no point in having separate columns for Date and Time. It does not make much sense
You can create the table like this
CREATE TABLE timeDate (
id INT,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
);
And if you want the Date part use this query
SELECT DATE(`ts`) FROM timedate WHERE id =someId
And if you want the Time part use this query
SELECT TIME(`ts`) FROM timedate WHERE id =someId