Home > database >  MYSQL database to save the date format for int, I want to switch to text format date, how to do it.
MYSQL database to save the date format for int, I want to switch to text format date, how to do it.

Time:10-14

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:

Create a new field, for example, mydate
The UPDATE table name SET mydate=FROM_UNIXTIME (` former field name `, '% Y % m % d')
  • Related