MySQL时间戳转换

时间:2014-08-11 18:19:32   收藏:0   阅读:212

将时间转换为时间戳:

select unix_timestamp( ‘2009-10-26 10-06-07‘ )

如果参数为空,则处理为当前时间 :

select from_unixtime(1256540102)

有些应用生成的时间戳是比这个多出三位,是毫秒表示,如果要转换,需要先将最后三位去掉,否则返回NULL

MySQL时间戳转换,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!