Home > Article > Backend Development > Use the convert function to convert. . . _PHP Tutorial
Add the convert conversion to the query. . .
convert(varchar(10), field name, conversion format)
For example:
select user_id,convert(varchar(10),date,11) as date from tb_user
Conversion format:
0 or 100 month dd yyyy hh:miAMPM
1 mm/dd/yy
2 yy.mm.dd
3 dd/mm/yy
4 dd.mm.yy
5 dd-mm-yy
6 dd month yy
7 month dd,yy
8 hh:mi:ss
9 or 109 month dd yyyy hh:mi:ss:mmmAMPM
10 mm -dd-yy
11 yy/mm/dd
12 yymmdd
101 mm/dd/yyyy
102 yyyy.mm.dd
103 dd/mm/yyyy
104 dd .mm.yyyy
105 dd-mm-yyyy
106 dd month yyyy
107 month dd,yyyy
108 hh:mi:ss
110 mm-dd-yyyy
111 yyyy/mm/dd
112 yyyymmdd