MySQL: How to copy column of same table to another column with unix time convert

96
October 18, 2021, at 11:30 AM

I got my solution on SO on how to copy data from a column to another column but I need to convert the "from column" unix to the datetime column. ColumnA is of type int and ColumnB is of type TIMESTAMP:


UPDATE foods
SET 
  ColumnB = FROM_UNIXTIME(ColumnA, '%Y %M %D %H:%i:%s')
WHERE
  ColumnB IS NULL

If ColumnA's value is 1633711068, after running the code, ColumnB becomes 0000-00-00 00:00:00. Any reason?

I'm not a DBA, I'm just learning as I go along with a codebase I've inherited.

READ ALSO
Multidimensional array replace with close range Javascript

Multidimensional array replace with close range Javascript

Let's say we have a List of ranges expressed in arrays with two elements [from, to]

48
bootstrap 5 bs-gutter-x throws off div's

bootstrap 5 bs-gutter-x throws off div's

My div alignment is being thrown off by the defaultrow class

36
Tkinter image not adding to text widget

Tkinter image not adding to text widget

I am trying to make text widget that get images from reddit then displaying it on a text widget, but for some reason, with no error, the image is not displaying on the widget

66
I'm having a little trouble implementing the Strategy pattern

I'm having a little trouble implementing the Strategy pattern

I confess that I'm having a bit of difficulty implementing the strategy pattern in a program that aims to display a different message daily (ExMessage of the day

51