一切福田,不離方寸,從心而覓,感無不通。

MySql时间戳函数

参考链接:https://www.cnblogs.com/jhy-ocean/p/5560857.html   MySql时间戳涉及的函数 date_format(date, format) 函数,MySQL日期格式化函数date_format() unix_timestamp() 函数 str_to_date(str, format) 函数 from_unixtime(unix_timestamp, format) 函数,MySQL时间戳格式化函数from_unixtime 时间转字符串

时间转时间戳

字符串转时间

字符串转时间戳

时间戳转时间

时间戳转字符串

附表 MySQL日期格式化(format)取值范围。   值 含义 秒 %S、%s 两位数字形式的秒( 00,01, …, 59) 分 %I、%i 两位数字形式的分( 00,01, …, 59) 小时 %H 24小时制,两位数形式小时(00,01, …,23) %h 12小时制,两位数形式小时(00,01, …,12) %k 24小时制,数形式小时(0,1, …,23) %l 12小时制,数形式小时(0,1, …,12) %T 24小时制,时间形式(HH:mm:ss) %r  12小时制,时间形式(hh:mm:ss AM 或 PM) %p AM上午或PM下午   周  %W 一周中每一天的名称(Sunday,Monday, …,Saturday)  %a 一周中每一天名称的缩写(Sun,Mon, …,Sat) %w 以数字形式标识周(0=Sunday,1=Monday, …,6=Saturday) %U 数字表示周数,星期天为周中第一天 %u 数字表示周数,星期一为周中第一天 天 %d 两位数字表示月中天数(01,02, …,31) %e  数字表示月中天数(1,2, …,31)  %D 英文后缀表示月中天数(1st,2nd,3rd […]

龙生   04 Jun 2021
View Details