2021-03-11
閱讀量:
511
mysql中date_format()函數(shù)可用的標(biāo)識符匯總
問:
mysql中date_format()函數(shù)可用的標(biāo)識符匯總
答:
DATE_FORMAT(date,format)
根據(jù)format字符串格式化date值
在format字符串中可用標(biāo)志符
%M 月名字(january……december)
%Y 年, 數(shù)字, 4 位
%y 年, 數(shù)字, 2 位
%a 縮寫的星期名字(sun……sat)
%d 月份中的天數(shù), 數(shù)字(00……31)
%e 月份中的天數(shù), 數(shù)字(0……31)
%m 月, 數(shù)字(01……12)
%c 月, 數(shù)字(1……12)
%b 縮寫的月份名字(jan……dec)
%j 一年中的天數(shù)(001……366)
%h 十二時制的小時(00……12)
%k 二十四時制的小時(0……23)
%i 分鐘, 數(shù)字(00……59)
%r 時間,12 小時(hh:mm:ss [ap]m)
%s 秒(00……59)
%p am或pm
%w 一個星期中的天數(shù)(0=sunday ……6=saturday )
%u 一年中的周數(shù)(1……53)






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
0條評論
0條評論
0條評論