Pgsql 获取当前周/季度 的开始和结束时间

select date_trunc('week', current_date::timestamp) as 周开始时间;
select date_trunc('week',current_date::timestamp) + '6 days' as 周结束时间;

 

select date_trunc('quarter', current_date::timestamp) as 季度开始时间;
select date_trunc('quarter', current_date::timestamp) + '3 month' - interval '1 d' as 季度结束时间;

posted @ 2021-08-22 16:14  微笑的_鱼  阅读(4230)  评论(1编辑  收藏  举报