1. select now()

mysql时间戳转换问题

2.select unix_timestamp(); 单位是秒

mysql时间戳转换问题

3.将时间戳转为有格式的时间

select from_unixtime(unix_timestamp());

mysql时间戳转换问题

4.格式化时间

select date_format('2019-06-13 17:23:36', '%Y-%m-%d');

mysql时间戳转换问题

select date_format(from_unixtime(unix_timestamp()), '%Y-%m-%d');

mysql时间戳转换问题

 

相关文章:

  • 2021-06-25
  • 2022-02-02
  • 2021-12-05
  • 2021-11-19
  • 2021-11-19
  • 2021-11-19
  • 2021-11-19
  • 2023-02-06
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2021-11-19
  • 2021-11-19
  • 2022-12-23
相关资源
相似解决方案