目录

Mysql 常用函数备忘

时间戳与日期格式转换

UNIX时间戳转换为日期用函数: FROM_UNIXTIME()

1
select FROM_UNIXTIME(1156219870);

https://cdn.xiaobinqt.cn/xiaobinqt.io/20220511/16f68bfe754148f1bd995b6aa0b2e74c.png?imageView2/0/q/75|watermark/2/text/eGlhb2JpbnF0/font/dmlqYXlh/fontsize/1000/fill/IzVDNUI1Qg==/dissolve/52/gravity/SouthEast/dx/15/dy/15
FROM_UNIXTIME

日期转换为UNIX时间戳用函数: UNIX_TIMESTAMP()

https://cdn.xiaobinqt.cn/xiaobinqt.io/20220511/d1182fbf011d43bf95af2b195956f88b.png?imageView2/0/q/75|watermark/2/text/eGlhb2JpbnF0/font/dmlqYXlh/fontsize/1000/fill/IzVDNUI1Qg==/dissolve/52/gravity/SouthEast/dx/15/dy/15
UNIX_TIMESTAMP