mysql时间字符串和时间戳转换

来源:互联网 发布:特定域名使用指定dns 编辑:程序博客网 时间:2024/06/06 04:53

1、MySQL中时间戳转字符串

如把'2017-07-17 11:07:16' 转成 '1500260836'

select unix_timestamp('2017-07-17 11:07:16');

2、mysql中时间字符串转时间戳

如把'1500260836' 转成 '2017-07-17 11:07:16'

select from_unixtime(1500260836);

原创粉丝点击