chenlu-vera

mysql时间戳转换

1、将时间转换为时间戳

select unix_timestamp(\'2009-10-26 10-06-07\')

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

2、将时间戳转换为时间

select from_unixtime(1256540102)

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

转自  https://blog.csdn.net/wind_324/article/details/8491946

分类:

技术点:

相关文章:

  • 2021-11-19
  • 2021-11-19
  • 2021-04-29
  • 2021-11-19
  • 2021-12-30
  • 2021-11-19
  • 2021-11-01
  • 2021-11-19
猜你喜欢
  • 2021-11-19
  • 2021-11-19
  • 2022-02-02
  • 2021-12-05
  • 2021-11-19
相关资源
相似解决方案