mysql 时间戳格式化日期yyyymmdd
非原创 exception 发表于:2023-11-17 01:33:24
  阅读 :38   收藏   编辑
  • 获取当前时间戳
select unix_timestamp()

1700155504
  • 时间戳转日期
select from_unixtime(1700155504)

2023-11-17 01:25:04
  • 时间戳转指定日期
select from_unixtime(1700155504, '%Y-%m-%d')

2023-11-17


select from_unixtime(1700155504, '%H:%i:%S')

01:25:04