0
SELECT *, FROM_UNIXTIME(`created_at`,"%Y-%m-%d %h:%i:%s") AS a 
FROM `tb_backup`;

created_at is timestamp string row name created_at=1668049479 a=2022-11-10 08:34:39

you can use inside stored procedure

Akina
  • 39,301
  • 5
  • 14
  • 25
  • 0 SELECT *,FROM_UNIXTIME(created_at,"%Y-%m-%d %h:%i:%s") AS a FROM tb_backup; created_at is timestamp string row name | created_at=1668049479 | a=2022-11-10 08:34:39 – Deepal Suranga Weerasuriya Nov 14 '22 at 04:15
  • what is the question? – ysth Nov 14 '22 at 04:25
  • Remove format from the function arguments - it is excess in your case. I.e. simply `SELECT *, FROM_UNIXTIME(created_at) AS a FROM tb_backup;`. https://dbfiddle.uk/jCObtYkP – Akina Nov 14 '22 at 05:14
  • Does this answer your question? [How to convert timestamp to datetime in MySQL?](https://stackoverflow.com/questions/5362874/how-to-convert-timestamp-to-datetime-in-mysql) – Markus Zeller Nov 14 '22 at 20:55

0 Answers0