美文网首页
mysql 时间戳与日期格式的相互转换

mysql 时间戳与日期格式的相互转换

作者: 永远love爱 | 来源:发表于2016-11-25 15:12 被阅读0次

PHP方式转换:
UNIX时间戳转换为日期用函数: date()
date('Y-m-d H:i:s', 1156219870);
日期转换为UNIX时间戳用函数:strtotime()
strtotime('2010-03-24 08:15:42');
1、UNIX时间戳转换为日期用函数:FROM_UNIXTIME()

select FROM_UNIXTIME(1156219870);

相关文章

网友评论

      本文标题:mysql 时间戳与日期格式的相互转换

      本文链接:https://www.haomeiwen.com/subject/vvxwpttx.html