I'm attempting to move data from the old table to a new table, however old table dates are of the datetime datatype, whilst new table dates are of the int datatype and accept timestamp values.
How can the old date be changed in a SQL query so that it can be added to a new table as a timestamp?
INSERT INTO `new_table` (`id`, `user_id`, `doctor_id`, `message_id`, `type`, `is_message`, `is_note`, `doctor_initials`, `call_status`, `message`, `date_created`, `date_updated`, `day`)
SELECT id, usid, drid, message_id, type, is_message, is_note, doctor, kall, message, datein, 123, ziua
FROM `old_table`;
I need a function to change an old date from a value to a timestamp, such as the function CONVERT INTO TIMESTAMP in the example above (datein) Any assistance would be greatly appreciated.
The new table's date-created field takes UNIX timestamp values like 1540642765.