https://knowledge.reontosanta.com/archives/14


select date_trunc('month',now())


select date_trunc('month',now()+'1 months')+'-1 days'

同理获取当天:


select date_trunc('day',now());
-- 当季第一天
select date_trunc('quarter',now());
-- 当周第一天:
select date_trunc('week',now());
-- 小时 取整:
select date_trunc('hour',now());

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2022-01-24
  • 2022-01-12
  • 2022-12-23
  • 2021-06-16
猜你喜欢
  • 2022-12-23
  • 2021-12-29
  • 2021-07-16
  • 2022-02-13
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案