Home > database >  MYSQL database to save the date format for int, I want to switch to date format, how to operate
MYSQL database to save the date format for int, I want to switch to date format, how to operate

Time:09-16

MYSQL database to save the date format for int, I want to date a text format, how to do,
Example: storage format for: 1585 XXXX 10 Numbers, I want to switch to 20200101, this format of time range queries, such as field called: date, table named test

CodePudding user response:

You in phpmyadmin directly into a datetime data type, if not just delete the column, and then to build a datetime column

CodePudding user response:

Now is this format program storage,

CodePudding user response:

From_unixtime the function,

CodePudding user response:

 

The select dateadd (hour, 8, dateadd (s, convert (int, '1496246518'), '1970-1-1'))

CodePudding user response:

From_unixtime the function, use this to turn out time is 19700101, faint
  • Related