unix_timestamp()

将时间转换为时间戳。(date 类型数据转换成 timestamp 形式整数)

 

1  select unix_timestamp('2016-03-23 11:10:10');

from_unixtime()

将timestamp 形式整数 转化为 date类型

select from_unixtime(1458703441);
select from_unixtime(1458703441,'%Y%m%d');

关于mysql 时间戳的限制:

timestamp 所能表示的范围在 1970  -  2038之间 。

超过这个范围 得到的时间将会溢出 得到的时间是null.

相关文章:

  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-11-04
  • 2022-12-23
猜你喜欢
  • 2021-07-25
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-12-20
相关资源
相似解决方案