PostgreSQL将日期转为年、月、日的函数date_trunc:
当前年: select date_trunc('year',now())
当前月: select date_trunc('month',now())
当前日: select date_trunc('day',now())
当前时: select date_trunc('hour',now())
当前分: select date_trunc('minute',now())
当前秒: select date_trunc('second',now())