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())
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/226586.html
標籤:其他
上一篇:計算經歷的時間
